Home > Net >  In the.net MVC mode, how to do it in the front page, click on the print button to adjust the corresp
In the.net MVC mode, how to do it in the front page, click on the print button to adjust the corresp

Time:09-25


above, I am in c/s mode parameter called fastreport statements, according to the normal

below is I'm going to the web page, click on the print button to call the statements code or code before c/s mode, click on the print button, the program will be an error, and then report it to come out, could you tell me how to write in the MVC mode to print button code

CodePudding user response:

Under the guidance of leaders, thank you very much

CodePudding user response:

To use the WebReport, similar to the following:
 public void Print () 
{
WebReport WebReport=new WebReport ();
System. Data. The DataSet DataSet=new System. The Data. The DataSet ();
The dataSet. ReadXml (" C://Program Files (x86)//FastReports//FastReport.Net//Demos//Reports//nwind.xml ");
WebReport. Report. The RegisterData (dataSet, "NorthWind");
WebReport. Report. The Load (" C:/Program Files (x86)//FastReports//FastReport.Net//Demos//Reports//Simple List. Usd ");
WebReport. EmbedPictures=true;
WebReport. PrintHtml ();
}

CodePudding user response:

Official said and I in order to realize the function of the different, I want to do is click on print button, and then the parameters of different data report

CodePudding user response:

Did you see the report is null, the debugging,
We are talking about is for Server MapPath path problem correctly

CodePudding user response:

Can add my QQ to see you, 3068516469

CodePudding user response:

Suggest you use lodop, can print the specified web page, the content can be generated according to the parameters,

Using Fastreport is also a generated page, and then the client printing, print is not on the server

CodePudding user response:

In the view page, click on the button from the background data, filling the page
Page print recommend adobe print plug-in
Or directly use js calls window. The print ();

The bigger difference of cs/bs

CodePudding user response:

The
Hello World, reference 7 floor response:
suggest you use lodop, can print the specified page, content can be generated according to the parameters,

Using Fastreport is generated web page, the client then print, not in the print servers

I watched lodop plug-ins, he this seems to be more troublesome, format written in code, all is not suitable for developing and implementing separate,,

CodePudding user response:

refer to autumn red fruits on the eighth floor response:
click on the button on the view page, from the background data, filling the page
Page print recommend adobe print plug-in
Or directly use js calls window. The print ();

The bigger difference of cs/bs
is not suitable for the current project,,

CodePudding user response:

After installing the fastreport bring relevant example, can open the project reference

CodePudding user response:

The
Hello World reference 3 floor, response:
WebReport is used, similar to the following:
 public void Print () 
{
WebReport WebReport=new WebReport ();
System. Data. The DataSet DataSet=new System. The Data. The DataSet ();
The dataSet. ReadXml (" C://Program Files (x86)//FastReports//FastReport.Net//Demos//Reports//nwind.xml ");
WebReport. Report. The RegisterData (dataSet, "NorthWind");
WebReport. Report. The Load (" C:/Program Files (x86)//FastReports//FastReport.Net//Demos//Reports//Simple List. Usd ");
WebReport. EmbedPictures=true;
WebReport. PrintHtml ();
}

Hello, I'm referring to the case of website, every time is in webReport. PrintHtml (); Cannot be instantiated

CodePudding user response:

Controller cannot directly PrintHtml (), to return to the ViewBag what of, front end again GetHtml () :

CodePudding user response:

[face
qq: 1. GIF [/face] Hello World, 13 floor response:]
Controller cannot directly PrintHtml (), to return to the ViewBag what of, front end again GetHtml () :


Hello, can add your QQ? My side in order to realize the function is different, and you want to click on the print button in your web page, and then according to the parameters passed this report to print a different data, their website https://www.fastreportcn.com/post/1897.html also wrote

CodePudding user response:

I tried the 2018 version, test the official code can be run, don't know whether your web. Config configuration didn't add in the below:
 & lt; Handlers> 

CodePudding user response:

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related