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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting automatically when report is ran

Status
Not open for further replies.

webshel29

IS-IT--Management
Jun 11, 2003
3
US
I am looking for a way as soon as the report is clicked on, it exports it to an Excel application for viewing. Any help on this matter would be appreciated.

 
Here is a small example using Delphi code...

CRW.ReportName:= {your crystal report file name};
CRW.Output := toExport;
CRW.ExportOptions.Destination := toFile;
CRW.ExportOptions.FileType := ExcelXLS;
CRW.ExportOptions.FileName := {your exported file name here};
CRW.ExportOptions.PromptForOptions := False;
CRW.Execute;

Paul Wesson, Programmer/Analyst
 
Paul,

Would have have similar code for VB? I am very good with crystal but a neophyte at VB, and I have been asked to do this exact thing....export a file when the report is viewed.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
I am running this code:

stringvar array times:=split({Field2}," ");
numbervar loops:=ubound(times);
numbervar i;
stringvar out;

for i:= 1 to loops do(


stringvar chnge:=times ;//3:308:1:18,6
stringvar end:= mid(chnge,instrrev(chnge,":")+1);
stringvar back:=right(end,len(end)-instr(end,",")) ;
stringvar front:=left(end,instr(end,",")-1 );
stringvar begin:=left(chnge,instrrev(chnge,":"));

out:=out + begin&back&"-"&front;
if i<loops then out:=out+&quot; &quot;);

out

I need to only execute this code on 244 characters, then stop and add continued to the end of the results...
 
I haven't used VB for quite some time, but the code I gave should be pretty close. The &quot;CRW&quot; object would just be the name of the Crystal component on your form (Crpe1.).

The export options should be very similar.

Paul Wesson, Programmer/Analyst
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top