PDA

View Full Version : Vrw api



Bob Worsley
15-Feb-2010, 09:40 AM
I started working with the API and cannot seem to get it to open a report. According to the cVisualReport.pkg code (the docs are a little too cryptic at this point)


Get ComReportOpen sReportPath to iReportId
If (bShowStatusPanel) Begin
Send Deactivate of hoStatusPanel
End
Move (iReportId <> -1) to bOk
returns the report ID. In my case it always returns 0 which means that either my report isn't opening or the code is incorrect. I'd expect that if the report wasn't opening it would return a -1 because of the test right after the ComReportOpen.

If that's indeed true - should return 0 if opened, -1 if not - then where does the ReportID come from?

If not true,
a) What does a return of 0 mean?
b) how do I tell what's wrong with the opening of my report? The path and report name are correct.

Native DB and the report returns data when in preview mode in the VRW.

p.s. Has anyone got an example of a functioning API report?

Vincent Oorsprong
15-Feb-2010, 03:50 PM
Bob,

We are working on the documentation, there will be a help file too.

When the report cannot be opened the return value is -1. When it can be opened the report id starts at 0 and can increment to higher numbers.

Soon we will have RC II out with an updated integration library too.

Bob Worsley
15-Feb-2010, 04:00 PM
If the return values are 0 and -1 then it would seem that the code is incorrect.

Get ComReportOpen sReportPath to iReportId
says it returns the ReportID.

Michael Mullan
15-Feb-2010, 04:11 PM
no,
the code iis right 0 is a valid reportid.

-1 is the only invalid reportid

Bob Worsley
15-Feb-2010, 04:51 PM
no,
the code iis right 0 is a valid reportid.

I wouldn't have thought so, but ok. I was getting an error saying "missing report ID" but could chalk that up to my lack of understanding how it works.

I've "fooled" around with the code some and seem to have gotten around that though I have no idea if correctly. Now I've found a bug in ExportReport which is expecting arguments but which has none. Guess I ain't gonna get this thing working today...

Bob Worsley
15-Feb-2010, 08:51 PM
So far, using the User's guide and the API, I could only get my report to print to the printer, neither the PDF export nor preview could I get to work.

Vincent Oorsprong
16-Feb-2010, 01:00 AM
Bob,

Look at the code we supply in the file VRWExportOptions.dg.

Vincent Oorsprong
16-Feb-2010, 01:03 AM
Bob,

If you use the COM methods you are responsible for the rest of the coding. We supply the cVisualReport class for integration.

After OpenReport (not COMOpenReport) you get the reportID and have to set this in the property piReportId to get other methods working without reporting missing report.

Bob Worsley
16-Feb-2010, 08:43 AM
Thanks Vincent, I'll give it another go

Bob Worsley
17-Feb-2010, 11:32 AM
Bob,

Look at the code we supply in the file VRWExportOptions.dg.
I tried calling oVRWPreviewPanel from my report and that works for preview and print, and when I click the Export button I get oVRWExportOptionsDialog as expected.

I enter the output file name, leave the default settings which is an export to PDF and click Ok, it does begin an export - I get a PDF file. But then it just sits there. No message, no nothing. If I click cancel on the export dialog and then close the report I get an unhandled exception.

I see how it's supposed to work now that I've had a look at the examples but it seems that there's still something I'm missing with this unless there's another bug. I did check the report to be sure that all data elements had proper font settings per the thread on the subject.

Vincent Oorsprong
17-Feb-2010, 12:09 PM
Bob,

Please retry with the just released RC II of Visual Report Writer.

Bob Worsley
17-Feb-2010, 12:17 PM
Didn't know it had been released, been a bit under the weather and probably not paying attention. Surprised you didn't announce it here. Getting it now thanks...

Bob Worsley
17-Feb-2010, 12:45 PM
No difference at all with RC II. Use the export dialog to export a PDF, then close it and the preview panel, get an unhandled exception.

Vincent Oorsprong
17-Feb-2010, 12:56 PM
Bob,

We will do soon...

Vincent Oorsprong
17-Feb-2010, 12:56 PM
Bob,

And the same from VRW itself?

Bob Worsley
17-Feb-2010, 02:52 PM
Bob,

And the same from VRW itself?
I never tried to export from VRW itself. Others said they had so I didn't try. I did go through some codejock registration heartburn with the new VRW RCII installation though, one of the controls wasn't actually there.

Just demonstrated the problem to Ulbe and sent the workspace to him, so we should get to the bottom of it shortly.

Bob Worsley
17-Feb-2010, 03:01 PM
Bob,

And the same from VRW itself?
Hmmmm.... I just tried the export option from VRW itself and get the exact same behavior. I get the dialog, click Ok, cancel it, but then try to open the PDF file that it exports and I get a message that the file is still open.

Next I close VRW and get an unhandled win32 exception.

If I then try to open the PDF file it says that the file is damaged and cannot be opened. Same thing I get with the API and that I demonstrated to Ulbe.