Need to create report designer and report viewer in wijmo

Posted by: kinshuk4u4u on 1 January 2020, 11:14 pm EST

  • Posted 1 January 2020, 11:14 pm EST


    I am developer in Soft Word Pvt. Ltd. And we have C1 licence for desktop version. we are moving desktop to web so we need report designer and report viewer in wijmo. can you please provide me sample code for report designer and viewer for check out requirement .

    Thanks & Regards
  • Replied 2 January 2020, 2:41 pm EST

    Hello Kinshuk,

    If you are already using the FlexReport created using ComponentOne in your desktop applications, you can also use these reports in the web version with wijmo.

    If you have not created any reports yet, then I would suggest you use the FlexReport designer to create reports. Please follow the link below to get started:

    To show the reports using wijmo, you can use the ReportViewer control. The ReportViewer control takes the C1WebApi link along with the report filename and report's name. To get started with ReportViewer, please go through the link below:

    You may also refer to the demo sample for reference:

    You can also view SSRS reports and ActiveReports in the ReportViewer control.

    If you have any other doubts, please feel free to contact us.

  • Replied 2 January 2020, 3:58 pm EST

    Hello Ashwin,

    Thanks for the reply

    currently we are using C1 4.2 version for desktop application . this report designer generate in XML. Please confirm wijmo support this XML file ? or we need to update report designer for wijmo?

  • Replied 2 January 2020, 4:29 pm EST

    I have checked wijmo purejs report viewer all sample they are nor working

    "systemjs.config.js:2 Uncaught ReferenceError: System is not defined"

    Please provide me sample code of report viewer in purejs
  • Replied 2 January 2020, 4:43 pm EST

    also i have tried to download code from provided below link this also not working same error "system is not defined"
  • Replied 2 January 2020, 5:17 pm EST

    1 more think i have downloaded C1 flex report designer but it allow only get data from sql query and Store Procedure . I want to bind options from API and json data. Please confirm is have any option to bind data from json and api ?
  • Replied 2 January 2020, 6:26 pm EST

    Hi Kinshuk,

    It seems like you are using C1Reports in your desktop applications. C1Report is now obsolete so I would suggest you use FlexReport in your web as well as your desktop application. To convert C1Report to FlexReport, you can follow the blog post below:

    In order to use FlexReport in a web application, you will need to host it on C1WebApi. To host your report on the web API, you may follow the procedure below:

    Regarding the ReportViewer sample:

    The issue occurs because the sample is created using SystemJS module loader. I have attached a purejs sample at the end.

    Regarding data from API:

    The FlexReport will be hosted on a web API which can directly connect to the database. So, I would suggest you use the database to bind the report.
    In case this option does not work, could you please let us know your requirements so that I could provide you a solution based on it.


  • Replied 2 January 2020, 6:45 pm EST

    we are converting out desktop application to web application in DotNet core 3.0.
    and this application is not connect with single database. its connections string set on user login. means its dynamic database application . we need to create customize report for every customer

    our requirement
    1. we will create report with API with JSON response.
    2. we want to use client side report viewer . we will just pass API URL.

    Its our basic requirement.

    Please suggest me what best way will you provide us for implement this feature.

    it would be good you can cone on chat or call then we will decide your tool will fulfill all our requirement or not ?

    you can contact me on +919413947286

  • Replied 2 January 2020, 8:38 pm EST

    Please confirm about the requirements
  • Replied 3 January 2020, 3:15 pm EST

    Hello Ashwin,

    Please let me know about requirement we are waiting for your reply .
  • Replied 5 January 2020, 6:28 pm EST

    Hi Kinshuk,

    Sorry for the late response.

    Currently, Report services are only compatible up to .Net Core 2.1 with .Net Framework. If you wish, you can create a WebApi application for hosting the reports in Visual Studio by using the 'C1 Web API Application for ASP.NET Core (.Net Framework)'.

    I have attached a sample application that hosts a simple report using JSON data. You will need to create a class that will return the report according to the JSON data provided by creating a DataTable from the data and setting this DataTable as the DataSource of the FlexReport.

  • Replied 6 January 2020, 6:33 pm EST


    I am checking your sample code . I have 1 more query can we bind report with DataSet or API (JSON) data. i need to bind multipal sub reports with Dataset and API(JSON). if yes then please provide sample code with Dataset and API(JSON)
  • Replied 7 January 2020, 5:56 pm EST


    Please refer to the updated sample attached.
    In this sample, I have created a class MemoryReportsProvider which gets the id that is passed to the report (in your case, the name or id of the user that is logged in).
    After getting the id, this class calls the GetJsonEmployees method providing id as the parameter. The GetJsonEmployees method calls another API where the data is contained and uses the returned JSON data to create a DataSet.
    This DataSet is then passed back to the MemoryReportsProvider and it sets this DataSet as the DataSource of the report.

    Let us know if you have any doubts.

  • Replied 8 January 2020, 6:02 pm EST

    Hello ,

    Hope you are doing well.

    Please check below my queries .

    1. The .flxr file always save in XML format or will in JSON?

    2. Static code you have used in Startup.cs its mandatory for declaration “MemoryReportsProvider” class ? I want to call dynamic call like customer report call “Customer.cs” class, invoice report call “Invoice.cs” class like this. Or if is possible to call dynamically then do i need to declare in startup.cs file ? Because i have thousands of reports of customers.

    3. Is it fixed to call “CreateDocument” function default when call report?

    4. Is it fixed report.DataSources take data in only form of DataTable ? Or Is take any other format like DataSet, Json like ?

    5. Please check below API. Its return JSON result. I need to create invoice report .In this API Parent node have Customer,Invoice general information like (No. ,Date,Total). And in “TransDetail” node have details list of products. Can you please let me know how can i create this type of report ? Both option API (JSON) data, and DataSet (Multipal Table)

    Please clear my above doubts.

    Thanks & Regards
  • Replied 8 January 2020, 11:19 pm EST

    Hello Ashwin

    I have made some change in the code . create two report "Trn" and "Dtl". and data get from data.json file. i have added dtl report as sub report on Trn report but at a time only 1 report is showing both are not . not able to set DataSources of sub report. Please check attached zip code. and let me know how to bind sub report.

    And also Please reply of my queries which ask in last post.

    Thanks & Regards
  • Replied 9 January 2020, 3:43 pm EST

    Hello Ashwin

    I am waiting for your response.
  • Replied 9 January 2020, 4:02 pm EST

    Hi Kinshuk,

    I am doing well thank you for asking.

    All of the FlexReports files are generated in XML but their file extension in .flxr.

    The CreateDocument is an abstract method of ReportsProvider class which is used to customize the reports dynamically. This method is called internally and we cannot change it.
    We are sorry but the report cannot take DataSet as the DataSource. It can only take DataTable, DataView or and IList object.

    We are currently working on your other queries. We will update you as soon as possible.

  • Replied 12 January 2020, 11:12 pm EST

    Hello Ashwin,

    I am waiting for your response , Please provide solution of sub report i have mention issue and attached project in last post.

    Thanks & Regards
  • Marked as Answer

    Replied 12 January 2020, 11:23 pm EST


    I have some doubts that I needed to ask.

    Regarding Q2:

    You do not need to specify the report location and name in the constructor itself. In the CreateDocument method, the first parameter is 'path' that contains the location and name of the report. You can use it in your application to load reports dynamically.
    If this does not solve the issue, could you please explain more about your use case?

    Regarding Q5:

    I was unable to understand your requirements in this query. You can create a report using the FlexReportDesigner and design it in any you wish. Could you please explain what is your issue regarding this?

    Regarding subreport:

    To solve this, you will first need to remove the 'Main' data source from the 'Dtl' report using the FlexReportDesigner. Then you will need to find the section of the Main report containing the SubReport and set its data source instead of loading the subreport using the Load method. Refer to the sample attached.

  • Replied 12 January 2020, 11:51 pm EST

    Thanks Ashwin for the solution of sub report. Please ignore other queries . I will check our other requirement with report . if i got any issue then will connect with you .

  • Replied 13 January 2020, 2:35 pm EST

    Hi Kinsuk,

    Glad to be able to help. Feel free to contact us if you have any issues.

  • Replied 14 January 2020, 4:43 pm EST

    Hello Ashwin,
    i have 1 more query . I want to print report without open.

    For Example : When customer click on button "Save & Print" then invoice will save and print report auto fire without open report.

    So Can you please let me know do i need to fire API call for print ?
    or i will call direct on My Project DotNet core 3.0 (without framework)

    Please provide solution for print in last project .


  • Replied 14 January 2020, 6:31 pm EST

    we are hosting this API on VPS server . then how can we print report on client printer ?
  • Replied 15 January 2020, 5:06 pm EST

    Hello Ashwin

    I am waiting for your reply.
  • Replied 15 January 2020, 5:08 pm EST

    I have hosted on VPS server for auto print. unable to do this. Please let know how can i fire auto print report on client printer?
  • Replied 15 January 2020, 5:54 pm EST

    Hi Kinshuk,

    Regarding printing:

    The reports are printed using the PrintDocument class of Wijmo which requires the data that needs to be printed, on the DOM. Therefore, the only way to print a report is to use the Print option provided in the ReportViewer control.

    Regarding IIS:

    I am working on publishing the application to IIS. I will update you once I have completed it and observed the results. In the meantime, please make sure that the report files are copied to the published directory. If not, then try copying the files manually.

  • Replied 15 January 2020, 6:29 pm EST

    Thanks for the response.

    Regarding printing:
    I have tried below code for print its working local system but when i try to upload on VPS server below code give error. I think it find printer on VPS server not in client system.


    Regarding IIS:
    yes report file is already have in publish directory . report view is working fine now but issue is in auto printing.
  • Replied 15 January 2020, 10:48 pm EST

    Hi Kinshuk,

    Glad to know that you were able to resolve the server issue.

    Regarding printing:

    The printing issue is expected because the Print method will print the FlexReport using the machine on which the application is running, as in your case, the VPS server. This method is mostly used in the WinForms application because it is not divided between server-side and client-side.
    That is why the ReportViewer controls provide their own implementation to print the reports. Currently, we can print the report using only the print option provided in the viewer. But I have added an enhancement request to add a method to print the report in ReportViewer control of wijmo. The internal tracking id of the case is 417245. I will update you as soon as this is implemented.

  • Replied 20 January 2020, 5:00 pm EST

    Hello Ashwin ,

    Hope you are well.

    I am facing issue for render converted report (C1 report to Flex report ).
    can you please check attached code and also I have put Report.xml and Report.flxr file in “File” folder.
    Please check code and let me know how can we render this report.

    Parent Report : WIN Sales Invoice
    Sub Report : WIN Sales Invoice detail

    Thanks &Regards
  • Replied 20 January 2020, 9:53 pm EST

    Please try to give solution ASAP . we are stuck..
  • Replied 20 January 2020, 10:29 pm EST

    And also let me know how to use below expression in field. because we are using many places in C1 Report and it not working in converted Flex Report

    LEFT(LTRIM(RTRIM(REPLACE(PartyAddress,CHR(10)," "))),54)+SPACE(54-LEN(LEFT(LTRIM(RTRIM(REPLACE(PartyAddress,CHR(10)," "))),54)))
  • Replied 21 January 2020, 6:42 pm EST

    Hello Ashwin ,

    IF condition is also not working . Please let me know what i need to do for execute below expression

    =If Len(Party)>1 Then LTrim(Party) Else RTrim(Party) EndIf

    Please reply first for this query.
  • Replied 21 January 2020, 7:27 pm EST

    Hi Kinshuk,

    I am working on this and will update you soon.
  • Replied 21 January 2020, 7:37 pm EST

    Hi Kinshuk,

    I converted the C1Report to FlexReport but I cannot check it since I do not have the data source to verify it and application provided is giving the following error:

    The type or namespace name 'GeneralClass' could not be found (are you missing a using directive or an assembly reference?)

    Could you please provide me with a working sample or the data source so that I can verify whether it is working or not. I am attaching the newly created Report.flxr file also.

  • Replied 21 January 2020, 8:53 pm EST

    Hello Ashwin,

    Please find attached project . I have removed unused code and now its running without error.

    I am stuck for IF Condition in expression. it not working . we have use below condition in almost report for customization print.

    =If Len(Party)>1 Then LTrim(Party) Else RTrim(Party) EndIf

    and I have done manually change in flex file for sub report. Change "Field " tag to "SubreportField". Then it run but we have lot of reports and we need to convert this to Flex report. Please Provide exact converter for running all existing functionally .
  • Replied 21 January 2020, 10:30 pm EST

  • Replied 22 January 2020, 4:40 pm EST

    Hello Ashwin,

    Hope you are doing well.

    I have tried your converted Flex Report . Its not working in case of subreport.

    Please give first solution of "IF Condition " in expression.

    Thanks & Reagrds
  • Replied 22 January 2020, 6:00 pm EST


    I am sorry for the late response. I am still working on this issue and will update you as soon as possible.

  • Replied 23 January 2020, 11:42 pm EST

    Hello Ashwin,

    Please try to give solutions fast. we are blocked with this issue.
  • Replied 26 January 2020, 7:25 pm EST

    Hi Kinshuk,

    Sorry for the delayed response.

    Since the report you provided was very large, I am trying to replicate the issue with a smaller report. I will update you once I have more information about the issue.
  • Replied 26 January 2020, 10:50 pm EST

    Hi Kinshuk,

    At my end, even if I set the Text property of the Field to this function, the function is not executed and is shown in the report as it is and not evaluated. Is this the same issue you are facing at your end?

  • Replied 27 January 2020, 5:27 pm EST

    Hello Ashwin,

    Yes I am facing same issue . but the main issue is "IF" condition in the expression. other are working like (LEFT,LTRIM,RTRIM etc).

    for example :
    LEFT(LTRIM(RTRIM(REPLACE(PartyAddress,CHR(10)," "))),54)+SPACE(54-LEN(LEFT(LTRIM(RTRIM(REPLACE(PartyAddress,CHR(10)," "))),54)))

    if you provide me solution of "IF" condition then i will continue to implementation.

    Thanks & Regards

  • Replied 27 January 2020, 8:40 pm EST

    Hi Kinshuk,

    This issue seems like a bug so I have asked the developers on this. The internal tracking id of the case is 418488. I will update you as soon as I will hear from them.

  • Replied 27 January 2020, 11:09 pm EST

    can you please send me URL where I can check status of issue with 418488 .
  • Replied 27 January 2020, 11:10 pm EST

    and also Please let me know time estimate of resolve this issue because we are blocked with issue. Its very urgent and important for me.
  • Replied 28 January 2020, 2:38 pm EST

    Hi Kinshuk,

    We do not have a URL for the case. The tracking id is only used for internal purposes. We only provide the internal ID here so that other engineers looking into this ticket can track your case.

    We have asked the developer to prioritize the issue and we will update you as soon as we will hear from them.

  • Replied 2 February 2020, 3:50 pm EST

    Hello Ashwin,

    Hope you are doing well.

    is it any good news regarding execute condition in reports ?

    I am waiting for your solution. I cant continue my work without this solutions.

    Thanks & Regards
  • Replied 3 February 2020, 4:04 pm EST

    Hi Kinshuk,

    I hope you are also doing well.

    I am really sorry but the issue is still with the dev team. They are investigating the issue with the highest priority. I will update you as I have more information.

  • Replied 5 February 2020, 8:31 pm EST

    Hi Kinshuk,

    The developers have said that the If condition expression was incorrect syntax-wise. The actual statement should be:
    Iif((Len(Party) > 1),LTrim(Party),RTrim(Party))

    You will need to update these statements in your report. You may go through the attached simple report for your reference.

    We are really sorry for the inconvenience caused.

  • Replied 5 February 2020, 10:14 pm EST

    Hi again,

    If you have any issues, please create a new thread as this thread is getting bigger and harder to track.

  • Replied 19 February 2020, 10:50 pm EST

    Hello Ashwin ,

    Hope you are well.

    Sorry for the delay response . I have tried provided If conditions and same syntax but still it not working . Please correct my issue . its very important part play for my requirement.

    I have attached report and screenshot of issue.

    Please try to resolve this issue ASAP. I will create new thread after resolve this issue.

    Thanks & Regards
  • Replied 24 February 2020, 5:02 pm EST

    Hi Kinshuk,

    The fields added in the FlexReport are of the Field class. If you want to add a calculated expression to the Data in the Field, you need to use the '=' operator. That means your expression should be:
    =Iif((Len(LIC1) > 0),"TIN  No."+Left(LIC1,20),"YES")

    Also, I ran the report with the original JSON data provided and I found that LIC1 is not a field in the data set. Can you please make sure that a simple LIC1 field is being displayed in the report without using the If expression?

Need extra support?

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

Learn More

Forum Channels