[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

VB.Net 2008, Creating PDF Files

Posted on 2013-06-26
9
Medium Priority
?
392 Views
Last Modified: 2013-07-05
Good Morning,

 I have a sub routine that creates a pdf file of a report that was created using Crystal Reports 2008.  I'm doing the following:

rptDoc.ExportToDisk(ExportFormatType.PortableDocFormat, g_strPDFPath & "\" & strFileName & "" & ".pdf")

The Issue:  Only on 2 machines (out of 40) do I have this issue.  Whenever they run this piece of code, they get an error that says <application name> has encountered a probelm and needs to close.  We are sorry for the inconvenience.

This only happens whne creating the PDF file.  I've tried commented out the displaying of the crystal report and just creating the pdf, that failed.  I tried commenting out the PDF and just displaying the crystal reprot and that worked.  I don't see why the above code is causing the issue.  Has anyone experienced this before??

Thanks,

Jim
0
Comment
Question by:transstates
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 39278288
can u wrap with try/catch when calling ExportToDisk?
the exception will tell you where the problem is.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 39278342
What are the differences on the 2 machines?

I assume the PDF export modules are installed on them?

mlmcc
0
 

Author Comment

by:transstates
ID: 39278454
When putting it in a try catch, it appearently gets to the .ExportToDisk and they bombs and never logs a message.  It a hard crash that exits the program and takes the user back to the desktop.

I changed it up a little....

Try

                Dim strFileName As String = "Remove" & " - " & cboPartNumber.Text
                With reportDocument1
                    .Load(g_strAssemblyChange) 'Path of the report
                    .ExportToDisk(ExportFormatType.PortableDocFormat, g_strPDFPath & "\" & strFileName & "" & ".pdf")
                End With

            Catch ex As Exception
                g_strCode = "ERR"
                g_strMessage = ex.Message.ToString()
                Call WriteErr(g_strCode, "Form1", "Printeport()", g_strMessage, "", ex.Message, 0)
                MsgBox("error has been written")
            End Try
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 101

Expert Comment

by:mlmcc
ID: 39278519
Have you tried other export types like Excel or Word?

mlmcc
0
 
LVL 15

Accepted Solution

by:
Ess Kay earned 1000 total points
ID: 39278602
reinstall crystal on the pc
0
 
LVL 18

Assisted Solution

by:vasto
vasto earned 1000 total points
ID: 39278743
I guess the problem is not in your code. Try to show the report in a viewer ( on screen) and export to PDF from the viewer. If it fails again then you probably need to take time to fix Crystal runtime on these machines
0
 

Author Comment

by:transstates
ID: 39278841
I will try to reinstall crystal.  This may take a bit, I have to wait for the user(s) to be gone or at a break point.  I will respond as soon as I can.  Thank you all!!
0
 
LVL 18

Expert Comment

by:vasto
ID: 39278920
Try first to export from the viewer.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 39278987
Crystal isn't installed on a client.  

Is this running as a thick or thin client application?

mlmcc
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question