Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

D2005 Crystal Win32 CRViewer

Status
Not open for further replies.

Smithy1001

Programmer
Jun 9, 2006
8
GB
I have a win32 app in D2005 and I have managed to use the RDC using a variant call etc. My problem is getting the CRViewer into the WIN32 component palette. I have created a unit from it called CRVIEWERLib_Tlb which I can create an instance of the componentat runtime, but I cannot interact with this programmatically (for instance "Showlastpage" just gets ignored) and i can only call its functions from within the procedure that the CRViewer is created in.

I've tried importing the Activex component in win32 but it never appears in the tool palette. How can I get it in there? If i can't get it in there, how can i stop crviewer from ignoring me?

My code is below:

var
Crystal,CRReport : olevariant
obj : TCrViewer //references the CRVIEWERLIB_TLB unit
Handle : HWND
begin
Handle := Findwindow(nil,Stok enquiry');
crystal := createoleobject('CrystalRuntime.application');
obj := TCRViewer.create(fStockEnquiry);
obj.parent := fStockEnquiry;
obj.parentwindow := handle;
obj.name := 'viewer';
obj.showlastpage //THIS GETS IGNORED!?
OBJ.BRINGTOFRONT;
obj.reportsource := crreport;
obj.viewreport;


 
I assume you are referring to a Delphi environment. I have no experience with developing in Delphi but it looks like you should call obj.showlastpage AFTER the report was rendered instead of Before. So simply move that call to the last line.

hth,
- Ido


Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top