iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I am suing the AllowExport="true" in the LayoutSettings. I am getting an error. See attached screenshot.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Hi Jocelyn,
Sorry but i can't replicate your issue since exporting works well on me, and your attachment can't be opened. From what you describe to me, you used "AllowExport="true", which is not right. You should set it as "AllowExport="Yes".
And remember to add one folder to save the export file and named it "TempReports" and give an "Allow" access for Everyone to access it. I hope it helps and do not hesitate to ask if you have any more questions.
Thank you,Andi Santoso
Hi all,
I have this error while I try to export my webgrid (in any format): "Printer does not support Letter papersize. Please use PaperKind.Custom in your PageSettings or specify a papersize supported by the current printer".
I've created a TempReports folder in my project root with full access for Everyone. What's wrong?
Regards
Nicola
Hi Nicola,
Sorry, but I can not reproduct your issue. From what I see, the error is not occur on the coding. It seems that something wrong with the printer of yours. Have you tried to turn off your printer? Or, if it is still not working, here is a workaround, please do following steps:
1. Open a WebGrid Serverside event called PrepareExportExecute.
2. Set the printer name to an empty string.
private void WebGrid1_PrepareExportExecute (object sender,ISNet.WebUI.WebGrid.PrepareExportExecuteEventArgs e) { e.ReportObject.Document.Printer.PrinterName = ""; }
I hope it helps and could you please to let me know if it is working. Thank you.
Best Regards,Andi Santoso
Hi Andi,
thanks for your reply.I tryied to put your code into my project but I have an error on ReportObject object (it seems to be not referenced on my project, but I set it!)
I've attached 2 images to explain my issue.
Please try this workaround for your issue.
Protected Sub WebGrid1_PrepareExportExecute(ByVal sender As Object, ByVal e As ISNet.WebUI.WebGrid.PrepareExportExecuteEventArgs) Handles WebGrid1.PrepareExportExecute Dim report As New DataDynamics.ActiveReports.ActiveReport3() report = e.GetType().GetProperty("ReportObject").GetValue(e, Nothing) report.Document.Printer.PrinterName = "" End Sub
I hope it helps and please let me know if it works on your issue.
Best Regards,
Andi Santoso
Sorry, but I can not reproduct your issue. From what I see, the error is not occur on the coding. It seems that something wrong with the printer of yours. Have you tried to turn off your printer?
This error is difficult to reproduce on a development computer because on a development computer, the computer is a client machine and a server at the same time.
This error is trying to say that the server where the website is running doesn't have a printer. As silly as it sounds, you must have a printer on the web server just to allow the exporting of grids. At least you don't have to have a real printer on the web server, you can install a dummy file printer and it will work.
To confirm this problem, on a development server, remove all printers, every last one of them. Now try to export the grid from a remote client computer (that computer can have printers or not, it doesn't matter). Then, install a file printer on the development server and you can immediately export grids when the website is accessed from the remote client, you don't even have to restart the server.
I hate having printers unecessarily added to production servers, but we had to do this just to support exporting from grids. We added one file printer as follows:
Printers
à
Add Printer
Local Printer
Select port “FILE: (Print to File)”
Manufacturer “HP”, Model “HP 2500C Series PCL5e” (the printer model that you use doesn’t actually matter)
Name the printer
Do not share the printer
You do not want to print a test page
Finish
Hi James,
Forgive me, I think I will need more time to discuss this with our Developer. I will let you know if I got news from them regarding this. Sorry for the inconvenience. Thank you and have a nice day.
It seems that adding the dummy printer only worked in the development environment and not on the production server. Why this is, I don't know. It is likely related to increased security in the production environment. We will remove the dummy printer from production and use the suggested code fix to allow exporting of the grid. Unfortunately, this is the only option left available to us. I must add the code that you suggested to 315 grids throughout our project in order to re-instate the exporting functionality that we had with WebGrid 3.5 but that we lost when we had to go to the WebGrid 4.0 version.
protected void wgSearchResult_PrepareExportExecute(object sender, ISNet.WebUI.WebGrid.PrepareExportExecuteEventArgs e) { DataDynamics.ActiveReports.ActiveReport report; report = (DataDynamics.ActiveReports.ActiveReport)e.GetType().GetProperty("ReportObject").GetValue(e, null); report.Document.Printer.PrinterName = ""; }
This code seems to work whether the web server has printers installed or not.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname