Hi everyone,
My problem is that when I press the print button in the window created by SalReportView(), a blank page prints.
I have seen that a developer had exactly the same problem in this forum and his answer was :
'What happens is, after the initial display to the report window, SAM_ReportFetchInit and Sam_ReportFetchNext are sent AGAIN when printing and AGAIN when redisplaying the report window! The same thing is true with zooming. So, you need to make sure your code in the message handlers reset so the data is selected again. In my case before returning FALSE in SAM_ReportFetchNext (when no more data) I had to issue the select again to prime for the next run through.'
I agree but I don't see exactly what code I have to write or which function I have to use in order to 'issue the select again to prime for the next run through'
Thanks for help.
Printing from SalReportView()
-
- Site Admin
- Posts: 463
- Joined: 05 Mar 2017, 20:57
- Location: Stroud, England <--> Tauranga, New Zealand
Re: Printing from SalReportView()
Firstly can you tell if the 'Print' button you talk about is programmer defined, with code behind it, or the default one supplied by ReportBuilder.
Greetings from New Zealand
Steve Leighton
Bankside Systems Ltd.
UK ♦ Australia ♦ New Zealand
www.banksidesystems.co.uk

Steve Leighton
Bankside Systems Ltd.
UK ♦ Australia ♦ New Zealand
www.banksidesystems.co.uk

Re: Printing from SalReportView()
The 'Print' button is the default one ( supplied by ReportBuilder )
-
- Site Admin
- Posts: 463
- Joined: 05 Mar 2017, 20:57
- Location: Stroud, England <--> Tauranga, New Zealand
Re: Printing from SalReportView()
You must be calling SqlPrepareAndExecute() somewhere - it should be where you trap SAM_ReportFetchInit.
This is where you first set up you SQL (select)statement, then call SqlPrepareAndExecute()using that SQL statement.
SAM_ReportFetchInit will fire every time you view or print, and hence so will your SQL statement be re-prepared every time.
If you trap SAM_ReportFetchNext, you can call SqlFetchNext()and (optionally) customise the result-set before it is sent to the report.
To send data to the report depending
upon the report level ( eg about to format the page header etc) trap "SAM_ReportNotify".
This is where you first set up you SQL (select)statement, then call SqlPrepareAndExecute()using that SQL statement.
SAM_ReportFetchInit will fire every time you view or print, and hence so will your SQL statement be re-prepared every time.
If you trap SAM_ReportFetchNext, you can call SqlFetchNext()and (optionally) customise the result-set before it is sent to the report.
To send data to the report depending
upon the report level ( eg about to format the page header etc) trap "SAM_ReportNotify".
Greetings from New Zealand
Steve Leighton
Bankside Systems Ltd.
UK ♦ Australia ♦ New Zealand
www.banksidesystems.co.uk

Steve Leighton
Bankside Systems Ltd.
UK ♦ Australia ♦ New Zealand
www.banksidesystems.co.uk

Who is online
Users browsing this forum: [Ccbot] and 0 guests