Section.Page.DrawLine the PenStyles.Solid does not work in Export to PDF

Posted by: developers on 3 September 2020, 1:09 am EST

    • Post Options:
    • Link

    Posted 3 September 2020, 1:09 am EST - Updated 30 September 2022, 8:00 am EST

    GrapeCity.ActiveReports.Document.Section.PenStyles.Solid does not work in Export to

    GrapeCity.ActiveReports.Export.Pdf.Section.PdfVersion.Pdf17

    I try GrapeCity.ActiveReports.Document.Section.PenStyles.Dot and then it works. Why?

    Her my following Code snippeds:

    GrapeCity.ActiveReports.Document.Section.Page page

    page.PenWidth = 2;

    page.ForeColor = System.Drawing.Color.Black;

    page.PenStyle = GrapeCity.ActiveReports.Document.Section.PenStyles.Solid;

    if I use Dot → then it works. But Solid does not work…

    page.PenStyle = GrapeCity.ActiveReports.Document.Section.PenStyles.Dot;

    The DrawText works but DrawLine not:

    page.DrawText(“Oli was here”, [RectangleF text]);

    page.DrawLine([float x1, float y1, float x2, float y2]);

    I use ActiveReports 14 and .Net Framework 4.7.2

  • Posted 3 September 2020, 1:26 am EST

    Hello,

    I am not able to reproduce the issue at my end. Please refer to the attached report and see if the issue is reproducible with the same. if not, could you please share stripped-down report or modify the existing one so that I can able to reproduce the issue at my end.

    Also, please share the exact version of AR14 that you are using at your end.

    Thanks,

    Mohit

    Untitled.zip

  • Posted 4 September 2020, 3:42 am EST - Updated 30 September 2022, 8:00 am EST

    Hello,

    Please try with the latest build as I am not able to replicate issue with the latest build. Please refer to the attached image.

    http://cdn.grapecity.com/ActiveReports/AR14/Hotfixes/ActiveReports-v14.1.20413.msi

    Thanks,

    Mohit

  • Posted 4 September 2020, 4:39 am EST - Updated 30 September 2022, 8:00 am EST

    I updated the AR Version. And did’t fix the bug.

  • Posted 4 September 2020, 5:32 am EST

    Here is my Project with Little upgrade → you can choose Solid or Dot

    WinFormAppForExport.zip

    And my list of nuget.Packages → App.config















































































    And I try with Foxit PDF Reader and Adobe Reader

  • Posted 6 September 2020, 9:41 pm EST - Updated 30 September 2022, 8:00 am EST

    Hello,

    Could you please share the full deployed application as I am getting the attached error at my end.

    You can share the full deployed application through google drive/dropbox or by any other method.

    Thanks,

    Mohit

  • Posted 7 September 2020, 12:23 am EST

  • Posted 9 September 2020, 1:21 am EST

    Hello,

    Thanks for the working sample. I am able to reproduce the issue and escalated the issue to the development team(AR-25072) and will inform you once I get any information from them.

    Thanks,

    Mohit

  • Posted 9 September 2020, 5:39 pm EST

    WinFormAppForExport.zip

    I write a little Solution about the Problem. In this solution you can reproduce the bug. In class “Program.cs” line number 167 you can test with PenStyles.Solid and PenStyles.Dot

    I use AR14.1.20320

  • Posted 9 September 2020, 10:30 pm EST

    Hello,

    ok is there Maybe a workaround?

    Until when can I expect a bugfix?

  • Posted 10 September 2020, 9:19 pm EST

    Hello,

    You can use the following workaround:

    private SectionDocument InsertLine(SectionDocument report, GrapeCity.ActiveReports.Document.Section.PenStyles penStyle)
            {
                // pack code attributes for portrait
                const float PackingCodeTop = 11.4f / 2.54f;
                const float PackingCodeLeft = 0.42f / 2.54f;
                const float PackingCodeWidth = 0.762f / 2.54f;
                const float PackingCodeInterval = 0.4233f / 2.54f;
                foreach (Page page in report.Pages)
                {
                    page.PenWidth = 2;
                    page.ForeColor = System.Drawing.Color.Black;
    		//set style to DOT and back to SOLID as workaround
                   page.PenStyle = PenStyles.Dot;
                    page.PenStyle = penStyle;
                  
                    var y = PackingCodeTop + (PackingCodeInterval * 0);
                    page.DrawLine(PackingCodeLeft, y, PackingCodeLeft + PackingCodeWidth, y);
    
                }
    
                return report;
            }
    

    Hope it helps.

    Thanks,

    Mohit

Need extra support?

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

Learn More

Forum Channels