C1Report/SuperLabel not works for Html (Web Application)

Originally Posted 27 October 2014, 10:24 am EST

  • Originally Posted 27 October 2014, 10:24 am EST

    I have a simple html text and I want it to be render in the C1Report/SuperLabel (WebSite).

    The html text run success in Windows Forms + C1SuperLabel :

    C1SuperLabel.Text = @"
    ComponentOne Logo
    ";

    P.S.But the font of text not equals or similar to browser output(IE/Chrome).

    But the same html text not works in C1ReportDesigner4.exe :

    0.open C1ReportDesigner and new a report
    1.place a SuperLabel in Detail
    2.set SuperLabel.Text :

    ComponentOne Logo


    3.preview, the 'ComponentOne Logo' was shown but image not shown.

    *There have the same problem with WebSite+C1Report/SuperLabel too.

    Tools :

    Visual Studio 2012
    Wijmo 2014 v1 (C1ReportDesigner.exe 4.6.20141.54715)

    Best regards

    Chris



  • Reply

    @manpreetkaur said:
    Hello,

    I was able to replicate the issue at my end, where in the image is not shown in the report designer. I have escalated the issue to the concerned team. I would let you know as soon as I get any information in this regard.

    Further, I was able to display the image in C1SuperLabel, only when I set the background color for the image tag to black, else the image is not visible. Here is the modified html code:

    <html><div>ComponentOne Logo</div><div><img src=http://demo.componentone.com/ASPNET/ControlExplorer/explore/css/images/icons/widget/FileExplorer.png style=background-color:black /><div></html>


    Hence, if you want to display the image in a web application, then I would suggest you to design the report in ReportDesigner but assign the HTML text to the text property of the superlabel field through code, i.e. before loading the report in C1ReportViewer. This would display the image correctly in the report.

    Hope it helps.

    Thanks,
    Manpreet Kaur






    HI

    >Hence, if you want to display the image in a web application, ...

    My requirement is convert Html to Image (C1Editor.Text -> C1SuperLabel.Text -> Image).

    The powerful of C1SuperLabel is, it can display the HTML content and
    it provide facilities to convert the content to image :

    C# :

    C1SuperLabel C1SuperLabel1;
    Bitmap bitmap;
    //
    C1SuperLabel1 = new C1SuperLabel();
    C1SuperLabel1.AutoSize = true;
    C1SuperLabel1.Text = @"
    ComponentOne Logo
    ";
    //
    bitmap = new Bitmap(C1SuperLabel1.Width, C1SuperLabel1.Height);
    C1SuperLabel1.DrawToBitmap(bitmap, new Rectangle(0, 0, bitmap.Size.Width, bitmap.Size.Height));
    pictureBox1.Image = bitmap;

    I can't find any solution for C1Editor.Text to C1Report's SuperLabel (C1Report's SuperLabel/Html/img now works now),
    so I want to use C1SuperLabel convert the Html to image then show the image in C1Report.
    or Is there have any good solution (C1Editor.Text -> C1Report(html/img))?

    Best regards

    Chris




  • Reply

    Hello,

    I was able to replicate the issue at my end, where in the image is not shown in the report designer. I have escalated the issue to the concerned team. I would let you know as soon as I get any information in this regard.

    Further, I was able to display the image in C1SuperLabel, only when I set the background color for the image tag to black, else the image is not visible. Here is the modified html code:

    <html><div>ComponentOne Logo</div><div><img src=http://demo.componentone.com/ASPNET/ControlExplorer/explore/css/images/icons/widget/FileExplorer.png style=background-color:black /><div></html>


    Hence, if you want to display the image in a web application, then I would suggest you to design the report in ReportDesigner but assign the HTML text to the text property of the superlabel field through code, i.e. before loading the report in C1ReportViewer. This would display the image correctly in the report.

    Hope it helps.

    Thanks,
    Manpreet Kaur
  • Reply

    Hello,

    As mentioned above, it seems that the background color of the image and of the PDF file or C1ReportViewer is same and hence the image does not gets displayed neither in the PDF file nor in the C1ReportViewer. When I changed the background color of the image to black then the image correctly displayed in the generated PDF file. Here is the code:

    <html><div>ComponentOne Logo</div><div><img src=http://demo.componentone.com/ASPNET/ControlExplorer/explore/css/images/icons/widget/FileExplorer.png style=background-color:black /><div></html>


    Kindly refer to the attached image which depicts the output observed at my end in the PDF file. I have also attached the updated sample, you may refer to the same. Hope it helps.

    Thanks,
    Manpreet Kaur


    2014/11/TestSuperLabelReportWebSite1_Updated.zip
  • Reply

    Hello,

    As per my understanding you are looking forward to display the image rendered in C1Editor using the HTML content in C1Report being displayed in C1ReportViewer. If this is the scenario, then as suggested above, you can add an empty SuperLabel field to your report through designer. Later, when you load the report in C1ReportViewer, you can simply set the text of the SuperLabel field using the C1Editor's text. Hence the image would be rendered in C1Report. Kindly refer to the attached sample application which implements the same. I have also attached a screenshot of the output observed at my end.

    Further, C1SuperLabel is a Winforms control and cannot be used in a Web application. Hence, the approach suggested above is an appropriate approach to display C1Editor image in C1Report.

    Hope it helps.

    Thanks,
    Manpreet Kaur
    2014/10/Report_HTML_Image.zip


  • Reply

    @manpreetkaur said:
    Hello,

    There is a possibility that the other image(wijmo_logo-asp.png) that you tried for testing the issue, has a default background color set to a color that can be displayed in C1ReportViewer or PDF file and hence it is not required to reset the background color for this image.

    However, it seems that it is required to set the background color for FileExplorer.png image to display it in the C1ReportViewer or PDF file. Hope it helps.

    Thanks,
    Manpreet Kaur





    HI

    I have met another problem, the result of SuperLabel was fragmented,
    reintroduce steps :

    1.goto the link(below), change the C1Editor to [Source View] mode and get the html content :

    http://wijmo.com/demo/explore/?widget=Editor&sample=Customize

    2.paste the html content into the code :

    NewReport.Fields["SuperLabel1"].WordWrap = true;
    NewReport.Fields["SuperLabel1"].Text =
    @"


    JavaScript


    ...


    ";
    ShowPDF(NewReport);

    3.Run the sample and press [Report1] button, the result of SuperLabel was fragmented
    (Page break abnormal, WordWrap have no effect,
    SuperLabel overlapped with footer, content was gone)

    Sample :

    Best regards

    Chris


  • Reply

    @manpreetkaur said:
    Hello,

    As per my understanding you are looking forward to display the image rendered in C1Editor using the HTML content in C1Report being displayed in C1ReportViewer. If this is the scenario, then as suggested above, you can add an empty SuperLabel field to your report through designer. Later, when you load the report in C1ReportViewer, you can simply set the text of the SuperLabel field using the C1Editor's text. Hence the image would be rendered in C1Report. Kindly refer to the attached sample application which implements the same. I have also attached a screenshot of the output observed at my end.

    Further, C1SuperLabel is a Winforms control and cannot be used in a Web application. Hence, the approach suggested above is an appropriate approach to display C1Editor image in C1Report.

    Hope it helps.

    Thanks,
    Manpreet Kaur




    HI

    It seem works with C1ReportViewer, but I do not use C1ReportViewer....

    Post Reply abnormal, see attachment please.

    Best regards

    Chris

    2014/11/TestSuperLabelReportWebSite14.zip
  • Reply

    Hello,

    There is a possibility that the other image(wijmo_logo-asp.png) that you tried for testing the issue, has a default background color set to a color that can be displayed in C1ReportViewer or PDF file and hence it is not required to reset the background color for this image.

    However, it seems that it is required to set the background color for FileExplorer.png image to display it in the C1ReportViewer or PDF file. Hope it helps.

    Thanks,
    Manpreet Kaur
  • Reply

    <blockquote><cite><a href="http://our.componentone.com/members/manpreetkaur/" rel="nofollow">@manpreetkaur</a> said:</cite>
    Hello,

    As mentioned above, it seems that the background color of the image and of the PDF file or C1ReportViewer is same and hence the image does not gets displayed neither in the PDF file nor in the C1ReportViewer. When I changed the background color of the image to black then the image correctly displayed in the generated PDF file. Here is the code:

    &amp;amp;amp;lt;html&amp;amp;amp;gt;&amp;amp;amp;lt;div&amp;amp;amp;gt;ComponentOne Logo&amp;amp;amp;lt;/div&amp;amp;amp;gt;&amp;amp;amp;lt;div&amp;amp;amp;gt;&amp;amp;amp;lt;img src=http://demo.componentone.com/ASPNET/ControlExplorer/explore/css/images/icons/widget/FileExplorer.png style=background-color:black /&amp;amp;amp;gt;&amp;amp;amp;lt;div&amp;amp;amp;gt;&amp;amp;amp;lt;/html&amp;amp;amp;gt;


    Kindly refer to the attached image which depicts the output observed at my end in the PDF file. I have also attached the updated sample, you may refer to the same. Hope it helps.

    Thanks,
    Manpreet Kaur</blockquote>



    HI

    I have test other .png file with no background-color: black and it is works (wijmo_logo-asp.png).
    images/icons/widget/FileExplorer.png is a special image file.

    Thanks

    Chris





  • Reply


    HI

    I have met another problem, the result of SuperLabel was fragmented,
    reintroduce steps :

    1.goto the link(below), change the C1Editor to [Source View] mode and get the html content :

    http://wijmo.com/demo/explore/?widget=Editor&sample=Customize

    2.paste the html content into the code :

    NewReport.Fields["SuperLabel1"].WordWrap = true;
    NewReport.Fields["SuperLabel1"].Text =
    @"


    JavaScript


    ...


  • ";
    ShowPDF(NewReport);

    3.Run the sample and press [Report1] button, the result of SuperLabel was fragmented
    (Page break abnormal, WordWrap have no effect,
    SuperLabel overlapped with footer, content was gone)


    Best regards

    Chris
  • Reply

    Hello,

    As per the development team, the issue that you are currently facing with the superlabel field occurs because of a limitation of C1Reports i.e. C1Report does not support splitting custom fields between pages and Superlabel is a custom field, hence you are not able to see the complete content in the superlabel field.

    You would need to set the "CanGrow" property of SuperLabel field to True and increase its height in such a manner that all the content assigned to the Superlabel field is displayed in one page, as it would not split to multiple pages in the report. Hope it helps.

    Thanks,
    Manpreet Kaur

  • Reply

    Hello,

    I was able to replicate the issue at my end. I have escalated the issue to the concerned team. I would let you know as soon as I get any information in this regard.

    Unfortunately, we are not able to find any workaround for this issue currently.

    Thanks,
    Manpreet Kaur
  • Reply

    @manpreetkaur said:
    Hello,

    There is a possibility that the other image(wijmo_logo-asp.png) that you tried for testing the issue, has a default background color set to a color that can be displayed in C1ReportViewer or PDF file and hence it is not required to reset the background color for this image.

    However, it seems that it is required to set the background color for FileExplorer.png image to display it in the C1ReportViewer or PDF file. Hope it helps.

    Thanks,
    Manpreet Kaur




    I have met another problem, the result of SuperLabel was fragmented,
    reintroduce steps :

    1.goto the link(below), change the C1Editor to [Source View] mode and get the html content :

    http://wijmo.com/demo/explore/?widget=Editor&sample=Customize

    2.paste the html content into the code :

    NewReport.Fields["SuperLabel1"].WordWrap = true;
    NewReport.Fields["SuperLabel1"].Text =
    @"


    JavaScript


    ...


  • ";
    ShowPDF(NewReport);

    3.Run the sample and press [Report1] button, the result of SuperLabel was fragmented
    (Page break abnormal, WordWrap have no effect,
    SuperLabel overlapped with footer, content was gone)


    Best regards

    Chris
  • Reply

    @manpreetkaur said:
    Hello,

    There is a possibility that the other image(wijmo_logo-asp.png) that you tried for testing the issue, has a default background color set to a color that can be displayed in C1ReportViewer or PDF file and hence it is not required to reset the background color for this image.

    However, it seems that it is required to set the background color for FileExplorer.png image to display it in the C1ReportViewer or PDF file. Hope it helps.

    Thanks,
    Manpreet Kaur




    HI

    I have met another problem, the result of SuperLabel was fragmented,
    reintroduce steps :

    1.goto the link(below), change the C1Editor to [Source View] mode and get the html content :

    http://wijmo.com/demo/explore/?widget=Editor&sample=Customize

    2.paste the html content into the code :

    NewReport.Fields["SuperLabel1"].WordWrap = true;
    NewReport.Fields["SuperLabel1"].Text =
    @"


    JavaScript


    ...


  • ";
    ShowPDF(NewReport);

    3.Run the sample and press [Report1] button, the result of SuperLabel was fragmented
    (Page break abnormal, WordWrap have no effect,
    SuperLabel overlapped with footer, content was gone)


    Best regards

    Chris
    Need extra support?

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

    Learn More

    Forum Channels