Fast Report in Window service

RamyaRamya cbe
edited 12:45PM in FastReport .NET
Hi,

I have created a windows service, in which on specified interval, a report will be generated, converted to PDF and an email will be triggered with the PDF as an attachment. The report files (.frx files) is present in another separate application (done in asp.net with C#). In the window service, am loading the report by giving the full path.

The problem am facing is, each time the service tries to create the report I get the below error.

"Exception has been thrown by the target of an invocation."

What should I do fix this issue.

Please help.

Thank you


Ramya

Comments

  • edited 12:45PM
    Hello,

    You probably need to turn off the config file (which is loaded when you create the first instance of a Report). Set

    FastReport.Config.WebMode = true

    before you create a Report instance.
  • RamyaRamya cbe
    edited 12:45PM
    Hi,

    Thank you for your reply.

    I added the above specified line before creating the instance of the report. But This din't solve my problem.

    I hope the problem is because of referring the .frx file which is placed outside the Window Service root directory. Will this be the case?

    I do no how to proceed further.

    Please provide your valuable suggestion and guide me.

    Thank you.


    Ramya
  • edited 12:45PM
    Hello,

    Please provide full stack trace.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.