Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Re: Exporting a crystal report to excel.


Message #1 by "Graeme Bryant" <graemebryant@x...> on Sun, 2 Mar 2003 20:20:41
This is a reported problem with windows 2000

You just have to set the Report Summary Title ( This will name the sheet !)

Here is the code we use

        Case crwDestExportExcel

            Options.StructSize = Len(Options)

            'The Following has been added to fix Excel "Invalid Sheet Name"
Bug MPB 09/04/02
            ReportSummary.StructSize = PE_SIZEOF_REPORT_SUMMARY_INFO

            ResultSum = PEGetReportSummaryInfo(liJob, ReportSummary)
            If ResultSum = 0 Then MsgBox "Failed to GET Report Summary Info
"

            ReportSummary.Title = mvarTitle & Chr(0)

            ResultSum = PESetReportSummaryInfo(liJob, ReportSummary)
            If ResultSum = 0 Then MsgBox "Failed to SET Report Summary Info
"

            'MPB
            lsSql = InputBox("Please enter the EXPORT destination...",
"Export to Excel", mvarExportDir & lsEntityName & "\" & AddDate(mvarTitle,
"XLS"), lsDate)

            If lsSql = "" Then
                mvarDestination = crwDestExport
                GoTo RETRY_OUTPUT
            End If

            liRet = crPEExportToDisk(liJob, lsSql & vbNullChar,
"U2FXLS.DLL" & vbNullChar, crUXFXls5Type, 0, 0, vbNullChar, vbNullChar)

Hope this helps




                                                                                                                    
                    "Graeme Bryant"                                                                                 
                    <graemebryant@x...       To:     "professional vb" <pro_vb@p...>                           
                    tra.co.nz>            cc:                                                                       
                                          Subject:     [pro_vb] Re: Exporting a crystal report to excel.            
                    03/03/2003                                                                                      
                    07:20 AM                                                                                        
                    Please respond                                                                                  
                    to                                                                                              
                    "professional                                                                                   
                    vb"                                                                                             
                                                                                                                    
                                                                                                                    




> When I export a crystal report (ver 8) to excel, I get error

Microsoft Excel File Repair Log - Renamed invalid sheet name.

Does anybody know what is the problem.


Regards,
Anita

Have you resolved this problem yet ? I have the same problem, but it only
happens with Excel XP. It works OK with Excel 2000.

Regards,

Graeme Bryant





  Return to Index