Showing posts with label print. Show all posts
Showing posts with label print. Show all posts

Monday, March 26, 2012

print button of Crystal report 11.5 didnt show pop-up dialog with AJAX

I have developed one web application with ASP.Net 2.0 with AJAX 1.0 and Crystal Report 11.5 Release 2.

When i put Crystal Report viewer in AJAX's update panel, Crystal report viewer is opened properly, but when i try to export or print the report from Crystal Report viewer, it is not showing any dialog box for export or print. Print mode of Crystal report viewer is ActiveX.

Can any body help regarding this problem with example(if possible) ?

Regards,

Krunal Shah

http://forums.asp.net/thread/1325110.aspx
(UpdatePanel does not allow the CrystalReportViewer control to print or export.)

http://forums.asp.net/thread/1660467.aspx
(button inside update panel Firefox problem)

etc., etc.

Print button in ReportViewer not working inside UpdatePanel

The print button in the toolbar of the VS reportviewer does not work when the reportviewer is contained inside an updatepanel. Does anyone know of a workaround or fix?

My report parameters are dynamically specified via dropdowns and calendars, so they must be inside an updatepanel...

Hi

I had a similar problem. To overcome I disabled the print button in the reportviewer.

I then added a button, that needs to exist outside of the updatepanel, that on clicking the button triggers code to print to pdf

Works OK and the output capability, in my case, is limited to pdf

Hope that is of help

Michael


Thanks Michael. That seems like a possible solution for me... When you click the button, does it open up Acrobat or just bring up the print menu? Also, may I see the code for the button? Thanks!


Hi

I found the solution to this problem via the attached post. It opens up acrobat.

https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=139828&SiteID=1

Also eliminates a new explorer window opening.

My code is:

ProtectedSub Button2_Click(ByVal senderAsObject,ByVal eAs System.EventArgs)

Try

Dim warningsAs Warning() =Nothing

Dim streamidsAsString() =Nothing

Dim mimeTypeAsString =Nothing

Dim encodingAsString =Nothing

Dim extensionAsString =Nothing

Dim bytesAsByte()

bytes = ReportViewer1.LocalReport.Render("PDF",Nothing, mimeType, encoding, extension, streamids, warnings)

Response.ContentType ="Application/pdf"

Response.Clear()

Response.ContentType = mimeType

Response.AddHeader("content-disposition","attachment; filename=Report." & extension)

Response.BinaryWrite(bytes)

Response.End()

Catch exAs Exception

EndTry

EndSub

This works for me. You will get an error though if the button is inside an update panel

Cheers

Michael

Print Problem With Updatepanel

HI,

Iam facing problem with update panel.I has a reportviewer and a updatepanel.Updatepanel consists of Reportviewer.Whenever i click on Print Option of Reportviewer,Postback ocurs But no print dialog appears.(So no print).How to Print report when it is is in updatepanel.

When i remove updatepanel Print wrks .But when i keep it in updatepanel NO PRINT ocurs

Plz help ...It is Very urgent

With regards,

Mahender

Any chance you can post the code?
<asp:UpdatePanelID="ReportViewerUpdatePanel"runat="server"UpdateMode="Conditional "ChildrenAsTriggers="true"><ContentTemplate><asp:UpdateProgressID="ReportViewerUpdateProgress"runat="server"><ProgressTemplate><divstyle="display:block; "><center>

Loading ...

<imgalt=""src="Images/Updatepanel/loading.gif"/></center></div></ProgressTemplate></asp:UpdateProgress>

<rsweb:ReportViewerID="ReportViewer1"runat="server"BackColor="WhiteSmoke"ProcessingMode="Remote"Height="100%"ShowBackButton="true"ShowFindControls="false"DocumentMapWidth="50%"ShowParameterPrompts="false"ShowRefreshButton="true"ShowReportBody="false"ShowPromptAreaButton="true"ShowToolBar="true"ShowExportControls="true"ShowZoomControl="false"Width="100%"EnableTheming="true"ShowCredentialPrompts="true"DocumentMapCollapsed="true"LinkActiveColor="Black"LinkActiveHoverColor="Chocolate"LinkDisabledColor="Gray"ExportContentDisposition="AlwaysInline"EnableViewState="true"ShowPrintButton="true"><ServerReportReportServerUrl="http://localhost/ReportServer$SQL"/></rsweb:ReportViewer>

</ContentTemplate><Triggers><asp:AsyncPostBackTriggerControlID="DropdownMenuLinkButton"EventName="Click"/>

</Triggers>

</asp:UpdatePanel>

Incode behind of One event.In my case Buttonclick

this is Code

ReportViewer1.ProcessingMode =

ProcessingMode.Remote;Uri u =newUri("http://localhost/ReportServer$SQL");

ReportViewer1.ServerReport.ReportServerUrl = u;

ReportViewer1.ServerReport.ReportPath =

"/thad/Report1";

ReportViewer1.AsyncRendering =

true;

ReportViewer1.ShowBackButton =

true;

ReportViewer1.ShowFindControls =

true;

ReportViewer1.ShowRefreshButton =

true;

ReportViewer1.ShowPrintButton =

true;

ReportViewer1.ShowReportBody =

true;

ReportViewer1.ShowPromptAreaButton =

true;

ReportViewer1.ShowToolBar =

true;// ReportViewer1.ShowExportControls = true;

ReportViewer1.ShowZoomControl =

true;

ReportViewer1.ToolTip =

"Report Viewer";

ReportViewer1.Width =

Unit.Percentage(100);

ReportViewer1.Height =

Unit.Percentage(100);//ReportViewer1.EnableTheming = true;

ReportViewer1.ShowCredentialPrompts =

true;

ReportViewer1.LinkActiveColor = System.Drawing.

Color.Black;

ReportViewer1.LinkActiveHoverColor = System.Drawing.

Color.Chocolate;

ReportViewer1.LinkDisabledColor = System.Drawing.

Color.Gray;

ReportViewer1.ShowPrintButton =

true;
<asp:UpdatePanelID="ReportViewerUpdatePanel"runat="server"UpdateMode="Conditional "ChildrenAsTriggers="true"><ContentTemplate><asp:UpdateProgressID="ReportViewerUpdateProgress"runat="server"><ProgressTemplate><divstyle="display:block; "><center>

Loading ...

<imgalt=""src="Images/Updatepanel/loading.gif"/></center></div></ProgressTemplate></asp:UpdateProgress>

<rsweb:ReportViewerID="ReportViewer1"runat="server"BackColor="WhiteSmoke"ProcessingMode="Remote"Height="100%"ShowBackButton="true"ShowFindControls="false"DocumentMapWidth="50%"ShowParameterPrompts="false"ShowRefreshButton="true"ShowReportBody="false"ShowPromptAreaButton="true"ShowToolBar="true"ShowExportControls="true"ShowZoomControl="false"Width="100%"EnableTheming="true"ShowCredentialPrompts="true"DocumentMapCollapsed="true"LinkActiveColor="Black"LinkActiveHoverColor="Chocolate"LinkDisabledColor="Gray"ExportContentDisposition="AlwaysInline"EnableViewState="true"ShowPrintButton="true"><ServerReportReportServerUrl="http://localhost/ReportServer$SQL"/></rsweb:ReportViewer>

</ContentTemplate><Triggers><asp:AsyncPostBackTriggerControlID="DropdownMenuLinkButton"EventName="Click"/>

</Triggers>

</asp:UpdatePanel>

Incode behind of One event.In my case Buttonclick

this is Code

ReportViewer1.ProcessingMode =

ProcessingMode.Remote;Uri u =newUri("http://localhost/ReportServer$SQL");

ReportViewer1.ServerReport.ReportServerUrl = u;

ReportViewer1.ServerReport.ReportPath =

"/thad/Report1";

ReportViewer1.AsyncRendering =

true;

ReportViewer1.ShowBackButton =

true;

ReportViewer1.ShowFindControls =

true;

ReportViewer1.ShowRefreshButton =

true;

ReportViewer1.ShowPrintButton =

true;

ReportViewer1.ShowReportBody =

true;

ReportViewer1.ShowPromptAreaButton =

true;

ReportViewer1.ShowToolBar =

true;// ReportViewer1.ShowExportControls = true;

ReportViewer1.ShowZoomControl =

true;

ReportViewer1.ToolTip =

"Report Viewer";

ReportViewer1.Width =

Unit.Percentage(100);

ReportViewer1.Height =

Unit.Percentage(100);//ReportViewer1.EnableTheming = true;

ReportViewer1.ShowCredentialPrompts =

true;

ReportViewer1.LinkActiveColor = System.Drawing.

Color.Black;

ReportViewer1.LinkActiveHoverColor = System.Drawing.

Color.Chocolate;

ReportViewer1.LinkDisabledColor = System.Drawing.

Color.Gray;

ReportViewer1.ShowPrintButton =

true;
<asp:UpdatePanelID="ReportViewerUpdatePanel"runat="server"UpdateMode="Conditional "ChildrenAsTriggers="true"><ContentTemplate><asp:UpdateProgressID="ReportViewerUpdateProgress"runat="server"><ProgressTemplate><divstyle="display:block; "><center>

Loading ...

<imgalt=""src="Images/Updatepanel/loading.gif"/></center></div></ProgressTemplate></asp:UpdateProgress>

<rsweb:ReportViewerID="ReportViewer1"runat="server"BackColor="WhiteSmoke"ProcessingMode="Remote"Height="100%"ShowBackButton="true"ShowFindControls="false"DocumentMapWidth="50%"ShowParameterPrompts="false"ShowRefreshButton="true"ShowReportBody="false"ShowPromptAreaButton="true"ShowToolBar="true"ShowExportControls="true"ShowZoomControl="false"Width="100%"EnableTheming="true"ShowCredentialPrompts="true"DocumentMapCollapsed="true"LinkActiveColor="Black"LinkActiveHoverColor="Chocolate"LinkDisabledColor="Gray"ExportContentDisposition="AlwaysInline"EnableViewState="true"ShowPrintButton="true"><ServerReportReportServerUrl="http://localhost/ReportServer$SQL"/></rsweb:ReportViewer>

</ContentTemplate><Triggers><asp:AsyncPostBackTriggerControlID="DropdownMenuLinkButton"EventName="Click"/>

</Triggers>

</asp:UpdatePanel>

Incode behind of One event.In my case Buttonclick

this is Code

ReportViewer1.ProcessingMode =

ProcessingMode.Remote;Uri u =newUri("http://localhost/ReportServer$SQL");

ReportViewer1.ServerReport.ReportServerUrl = u;

ReportViewer1.ServerReport.ReportPath =

"/thad/Report1";

ReportViewer1.AsyncRendering =

true;

ReportViewer1.ShowBackButton =

true;

ReportViewer1.ShowFindControls =

true;

ReportViewer1.ShowRefreshButton =

true;

ReportViewer1.ShowPrintButton =

true;

ReportViewer1.ShowReportBody =

true;

ReportViewer1.ShowPromptAreaButton =

true;

ReportViewer1.ShowToolBar =

true;// ReportViewer1.ShowExportControls = true;

ReportViewer1.ShowZoomControl =

true;

ReportViewer1.ToolTip =

"Report Viewer";

ReportViewer1.Width =

Unit.Percentage(100);

ReportViewer1.Height =

Unit.Percentage(100);//ReportViewer1.EnableTheming = true;

ReportViewer1.ShowCredentialPrompts =

true;

ReportViewer1.LinkActiveColor = System.Drawing.

Color.Black;

ReportViewer1.LinkActiveHoverColor = System.Drawing.

Color.Chocolate;

ReportViewer1.LinkDisabledColor = System.Drawing.

Color.Gray;

ReportViewer1.ShowPrintButton =

true;

Printable Client Reference Available?

Is there a pdf or word doc of the complete ASP.NET AJAX client reference that is ready to print on standard 8 1/2" x 11" paper?

hi,

AFAIK the closest you can get is the downloadable documentation in ajax.asp.net/docs

Printing TabContainer

Hi there!

Just wondering if anyone has managed to achieve the following:

I've got a page with a TabContainer in it... and I want to print it. By default the printed page will show the tab container just as it appears on screen.
But that's not what I want!!
I want to the printed page to reflect the contents of the TabContainer e.g.

Tab1

Tab1's contents get rendered

Tab2

Tab2's contents get rendered

etc. etc.

I've had a brief look at how to accomplish this, but am realising this is probably going to take a fair bit of time and effort to do. So I was wondering if anyone had "done the work for me" and I could crib a solution together!!!

Now I suppose you want to know why I want to do this... well basically I'm going to have 100's of pages containing tabs that my users can view. Despite the information being available on screen they love to print anything and everything off for their own records. I really don't want to end up 2 versions of every page... 1 for on screen display... and one made nice and pretty for printing purposes!!

My current thoughts are:

    Write an extender to hook into the beforeprint and afterprint events on the client to "pretty" everything up.

    Write some @dotnet.itags.org.media print and @dotnet.itags.org.media screen to maybe deal with the changes

    Probably my favourite option... write a control adapter for the TabContainer... this could look at a querystring parameter to determine if I am trying to render a printable version or not. If not, render as normal, otherwise change the output so that each TabPanel is visible and lined up vertically one after the other.

Any ideas/thoughts??

Cheers,

James

Hmmm... been thinking about this a fair bit more since I posted... I'm now convinced that the ControlAdapter route is the best.

I'm playing round with a solution that seems to work quite well (and thankfully took a lot less time than I originally anticipated).
Still got a few things to sort out though to make it look "right"!


[Ignore]


[Sorry ignore again]