PDF-Export is sometimes not working

Posted by: basti on 8 September 2017, 2:40 pm EST

  • Posted 8 September 2017, 2:40 pm EST

    <P> </P>
    <P>Hello,</P>
    <P>I'm trying to export my Spread-Data to PDF. I'm using the latest FarPoint 5 Spread for Windows Forms. In some cases the export works very well, but sometimes the ExportFunction creates a 0-byte-PDF and when I'm tying to open the exported PDF, it says "FDF corrupt..."</P>
    <P>As you can see in the attached Screenshot, the Spread is filled with data, but nothing is exported!</P>
    <P>Here is the code for my pdf-export:</P><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>
    <P>Dim</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> f </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>As</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>New</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> System.Windows.Forms.</FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>SaveFileDialog</P></FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
    <P></FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>Dim</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> printset </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>As</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>New</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> FarPoint.Win.Spread.</FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>PrintInfo</P></FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
    <P> </P>
    <P></FONT></FONT><FONT color=#008000 size=2 face=Consolas><FONT color=#008000 size=2 face=Consolas><FONT color=#008000 size=2 face=Consolas>'Export des FarPoint Grids</P></FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
    <P></FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>With</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> f</P>
    <P>.Filter = _</P>
    <P></FONT></FONT><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas>"PDF-Dateien (*.pdf)|*.pdf|Alle Dateien (*.*)|*.*"</P></FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
    <P>.FilterIndex = 1</P>
    <P>.Title = </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>My</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>.Application.cParameter.Get_Meldung(93)</P>
    <P></FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>If</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> .ShowDialog = Windows.Forms.</FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>DialogResult</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>.OK </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>Then</P></FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
    <P>printset.PdfWriteMode = FarPoint.Win.Spread.</FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>PdfWriteMode</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>.New</P>
    <P>printset.PrintToPdf = </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>True</P></FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
    <P></FONT></FONT><FONT color=#008000 size=2 face=Consolas><FONT color=#008000 size=2 face=Consolas><FONT color=#008000 size=2 face=Consolas>'printset.PdfStream = c</P></FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
    <P>printset.PdfWriteTo = FarPoint.Win.Spread.</FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>PdfWriteTo</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>.File</P>
    <P>printset.PdfFileName = f.FileName</P>
    <P>printset.Preview = </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>False</P></FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
    <P>printset.ShowColor = </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>True</P></FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
    <P></FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>Dim</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> dr() </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>As</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> </FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>DataRow</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> = </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>My</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>.Application.cAktKst.Gruppen.Select(</FONT></FONT><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas>"Gruppen_ID="</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> & </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>My</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>.Application.cAktKst.GruppenID)</P>
    <P>printset.Header = </FONT></FONT><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas>"/fb1/fz""12""QuAP - Matrix Umfeld: "</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> + tscmbUmfeld.Text + vbNewLine + </FONT></FONT><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas>"Gruppe: "</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> + dr(0).Item(</FONT></FONT><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas>"Gruppenname"</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>)</P>
    <P>printset.HeaderHeight = 70</P>
    <P>sprMatrixUmfeld.Sheets(0).PrintInfo = printset</P>
    <P>sprMatrixUmfeld.PrintSheet(-1)</P>
    <P>MsgBox(</FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>My</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>.Application.cParameter.Get_Meldung(111), </FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>MsgBoxStyle</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>.Information)</P>
    <P></FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>Else</P></FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
    <P></FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>Exit Sub</P></FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
    <P></FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>End</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>If</P></FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
    <P></FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>End</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>With</FONT></FONT></FONT></P>
    <P><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas></FONT></FONT></FONT> </P>
    <P><FONT size=2 face=Consolas><FONT size=2 face=Consolas><FONT color=#000000 size=2 face=Consolas>I hope you can help me! It seems to be verry urgent for us! I can't send you our project, because it is too complex and as I said sometimes the export works, sometimes not!</FONT></FONT></FONT></P>

  • Replied 8 September 2017, 2:40 pm EST

    <p>Do you have a data set that reliably fails to export to pdf? </p><p>If the answer to the last question was no then do you have any general information that would help us to see your issue?</p><p>If the answer was yes then does it export to excel or xml or text?</p><p>If the last answer was no, can you create a small sample app that creates the data that fails to export? </p><p>If you export to these other formats then reload it does it continue to fail to export to pdf? </p><p>If the answer to that last question was yes can you send us the excel, xml, or text file?</p><p>If it was no can you create a small sample app that creates the data that fails to export?</p>
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels