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

     


    Hello,


    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..."


    As you can see in the attached Screenshot, the Spread is filled with data, but nothing is exported!


    Here is the code for my pdf-export:

    <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> 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

    </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>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

    </FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>

     


    </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

    </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><FONT size=2 face=Consolas><FONT size=2 face=Consolas> f


    .Filter = _


    </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 (*.*)|*.*"

    </FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>

    .FilterIndex = 1


    .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)


    </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

    </FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>

    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


    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

    </FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>

    </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

    </FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>

    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


    printset.PdfFileName = f.FileName


    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

    </FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>

    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

    </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>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)


    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>)


    printset.HeaderHeight = 70


    sprMatrixUmfeld.Sheets(0).PrintInfo = printset


    sprMatrixUmfeld.PrintSheet(-1)


    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)


    </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>Else

    </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>Exit Sub

    </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>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

    </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>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>


    <FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas></FONT></FONT></FONT> 


    <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>



  • Replied 8 September 2017, 2:40 pm EST

    Do you have a data set that reliably fails to export to pdf?

    If the answer to the last question was no then do you have any general information that would help us to see your issue?

    If the answer was yes then does it export to excel or xml or text?

    If the last answer was no, can you create a small sample app that creates the data that fails to export? 

    If you export to these other formats then reload it does it continue to fail to export to pdf?

    If the answer to that last question was yes can you send us the excel, xml, or text file?

    If it was no can you create a small sample app that creates the data that fails to export?

Need extra support?

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

Learn More

Forum Channels