Telerik Forums
Reporting Forum
0 answers
121 views
Hi ,Every one

I am  doing one project  .My requirement is when i click custom button  than report is printing  with out open report .i worte this code .It's working develop system.But it's not working on server and other system.How to print report in custom button click event .

this is my code  How to find this please give me  any example 


 if (e.CommandName == "Print"
            { 
                int? fee_receipt_id = int.Parse(e.CommandArgument.ToString()); 
                int? status_code = null
                int? call_user_id = LogonDetails.Instance.sys_lclvar_user_id; 
                int? call_screen_id = GetScreenId(); 
                int? session_id = LogonDetails.Instance.sys_lclvar_session_id; 
                string call_ip_address = CommonMethods.CurrentIP; 
                bool? audit_report_execution = LogonDetails.Instance.sys_lclvar_audit_user_action; 
                bool? audit_user_action = LogonDetails.Instance.sys_lclvar_audit_user_action; 
                string status_text = String.Empty; 
                var printdata = ReportsManager.get_report_fee_receipt( 
                     fee_receipt_id, call_screen_id, call_user_id, session_id, call_ip_address, audit_user_action, audit_report_execution, ref status_code, ref status_text); 
                if ((!status_code.HasValue) || (status_code.Value != 0)) 
                { 
                    DisplayMessage(false, status_text); 
                    return
                } 
                string strTitle = LogonDetails.Instance.sys_lclvar_facility_name; 
                 
                var report = new TelerikComponentsWS.Reports.RepFeeReceipt(); 
                report.DataSource = printdata; 
                Telerik.Reporting.Drawing.ExternalStyleSheet exx = new Telerik.Reporting.Drawing.ExternalStyleSheet("~\\css\\ReprotStyleSheet.xml"); 
                report.ExternalStyleSheets.Add(exx); 
                report.ReportParameters[0].Value = strTitle; 
                using (System.Windows.Forms.PrintDialog printDlg = new System.Windows.Forms.PrintDialog()) 
                { 
                    printDlg.AllowSomePages = true
                    printDlg.AllowCurrentPage = false
                    printDlg.UseEXDialog = true
 
                    if (System.Windows.Forms.DialogResult.OK == printDlg.ShowDialog()) 
                    { 
                        Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor(); 
                        reportProcessor.PrintReport(report, printDlg.PrinterSettings); 
                    } 
                } 
                ////Telerik.Reporting.Processing 
                //System.Drawing.Printing.PrinterSettings printerSettings = new System.Drawing.Printing.PrinterSettings(); 
                //// Adjust the printer settings if necessary... 
                //System.Drawing.Printing.PrintController standardPrintController = new System.Drawing.Printing.StandardPrintController(); 
                //printerSettings.PrinterName = "MyHomePrinter"; 
                //// Print the report using the printer settings. 
                //Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor(); 
                //reportProcessor.PrintController = standardPrintController; 
                //reportProcessor.PrintReport(report, printerSettings); 
 
               
            } 




thanks and regards
shanker.B
shanker bangari
Top achievements
Rank 1
 asked on 10 Jun 2010
1 answer
273 views
  I am new to Telerik reporting, and I have just tried using it via the Trial version (Q1 2010).  I have successfully created a report and viewed it using a WinForms application, but when I try to use the WPF viewer I hit a problem.

  The problem occurs when I create a WPF Application, and then I try to drag the "ReportViewer" WPF component to a Xaml window.  I am then presented with the error:
 
"Cannot find type 'Telerik.Windows.Controls.ThemeResourceKey'. The assembly used when compiling might be different than that used when loading and the type is missing.  Error at object 'System.Windows.ResourceDictionary' in markup file 'Telerik.ReportViewer.Wpf;component/Themes/OfficeBlack/ReportViewer.xaml'."

  I have found that if I add a reference to Telerik.Windows.Controls.dll, Telerik.Windows.Controls.Input.dll, Telerik.Windows.Controls.Navigation.dll, and Telerik.Windows.Data.dll from the samples at \Program Files\Telerik\Reporting Q1 2010\Examples\CSharp\WpfDemo\bin, that everything seems to work fine.  But it is not until those references are added, which were not included as part of the Q1 2010 trial binaries, except specifically from that sample.

  Is this expected, and is it fine to include those references?  Will updates be included to those as part of the next update of reporting, or how else would one get those on an ongoing basis?

Chris Achille
Steve
Telerik team
 answered on 10 Jun 2010
3 answers
326 views
Hi,

I am trying to implement Telerik Reporting in our Silverlight application, and I am having a problem connecting Telerik Report Services to a Silverlight Report Viewer.  In one solution I have a Windows Azure project running a Web Role that contains a WCF service (ReportService.svc) and a project with the Repors (ReportLibrary) as instructed on this video (http://tv.telerik.com/reporting/video/telerik-reporting-getting-started-with-silverlight-report-viewer), and on the other solution I have a Silverlight app with a Silverlight Report Viewer.  When I try to setup the Silverlight client I get an error. (see image attachment).

The XAML code looks like this on the client side.

<UserControl x:Class="ROPComposite.Report.Telerik_Report.TelerikReportView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:reportViewer="clr-namespace:Telerik.ReportViewer.Silverlight;assembly=Telerik.ReportViewer.Silverlight"
       
    xmlns:telerikNav="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
    xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
    xmlns:telerikPrimitives ="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls"
    xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input">

    <Grid x:Name="LayoutRoot" Background="White">
        <reportViewer:ReportViewer x:Name="xReportViewer"
                                   ReportServiceUri="http://127.0.0.1:81/Service/ReportService.svc"
                                   Report="ReportLibrary.AllPatients, ReportLibrary,  Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
        </reportViewer:ReportViewer>
    </Grid>
</UserControl>

The configuration for the service looks like this on the server side.

        <behavior name="ReportServiceBehavior">
          <dataContractSerializer maxItemsInObjectGraph="10000000"/>
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
          <useRequestHeadersForMetadataAddress>
            <defaultPorts>
              <add scheme="http" port="81"/>
              <add scheme="https" port="444"/>
            </defaultPorts>
          </useRequestHeadersForMetadataAddress>
        </behavior>
...
      <endpointBehaviors>
        <behavior name="WebBehavior">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
...
      <service name="Telerik.Reporting.Service.ReportService" behaviorConfiguration="ReportServiceBehavior">
        <endpoint address="" binding="basicHttpBinding" contract="Telerik.Reporting.Service.IReportService">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint address="resources" binding="webHttpBinding" behaviorConfiguration="WebBehavior" contract="Telerik.Reporting.Service.IResourceService"/>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>

I know the Report works because I created an aspx page and I was able to see it using the Web Report Viewer, but not through WCF.

On the Reporting documentation ( http://www.telerik.com/help/reporting/silverlight-hosting-in-iis.html ) on how to Host a WCF Service for reports, I don't understand how Service class (ReportService.svc) knows what library the reports are.  Just by adding a reference to the library containing the reports, is that all I need to do?

I would appreciate all the help I can get.
Steve Johnson
Top achievements
Rank 1
 answered on 10 Jun 2010
4 answers
167 views
I am using the Reporting tutorial and am having a problem after creating the first two steps in the solution.  The example uses the Adventureworks SQL database.  I have created a Class Library that contains a Telerik Report.  It previews just fine and contains the full data from the database.

Then I created a VB Windows App as part of the solution with a Telerik ReportViewer to view this sample report.  Everything setup the way the tutorial showed, but when I ran the solution (the Windows App is the startup project), I receive a long red, error message about not being able to connect to the database.  See the attached file named reportquestion1.gif .

The VIsual Studio 2010 window is captured in reportlquestion2.gif .

Why does the report preview just fine with the data from the database, but then will not run when part of the whole solution?  The same connection string is in the report definition.  So why can't it make the connection?

Thanks in advance!
Lynn
Top achievements
Rank 2
 answered on 10 Jun 2010
1 answer
96 views
Hi,

I am evaluating the Reporting module and cannot get the report wizard to work with Advantage Database Server.

I set up the  ADS .NET Provider connection string but when it goes to retrieve the tables info, it just comes up the a message box which says 'Advantage.Data.Provider'.

I am using Q1 2010 trial.

Regards

Mike
Steve
Telerik team
 answered on 09 Jun 2010
1 answer
84 views
I am planning on using the RichTextBox feature of Silverlight 4, and will be storing the contents of the RichTextBox in my database.  Can the current version of the Silverlight ReportViewer and Telerik reporting handle the RichTextBox contents when displaying/printing?
Steve
Telerik team
 answered on 09 Jun 2010
1 answer
213 views
Hi
I have a problem when ReportBook save as PDF File.
i  had read this http://www.telerik.com/community/forums/reporting/telerik-reporting/export-to-pdf-does-not-support-chinese-characters.aspx and http://www.telerik.com/community/forums/reporting/telerik-reporting/support-chinese-language.aspx
but still can't fix my problem.
is any solution can provide me? or Telerik Reporting can't support Chinese Language (Taiwan)??

i wanna use my font type to create report, and let my customer open it with readable font type.


Steve
Telerik team
 answered on 09 Jun 2010
1 answer
160 views
In CrystalReport,we can save a data bounded report to rpt file, then we can use a viewer to load that file to show that report in other computer.
Is there any similar way to do this in Telerik Reporting?
Steve
Telerik team
 answered on 09 Jun 2010
5 answers
101 views
Hey there.

Just got another little problem and a question.

I've designed a kind of catlogue.
My catalogue is grouped by manufacturer.
The report itself has two columns.
Now i want to print in the page footer the current manufacturer logo.
I've figured out, that this is not possible (page footer) so i thougt i maybe can print in the group footer.
this would work fine but the group footer is only shown half the page width because of the second column i think.

How can i solve this?

Now to my question:
In Microsoft Access for example i can set the column-fill-direction. (straight, zig zag...)
Is this possible with telerik too?

Peter
Telerik team
 answered on 08 Jun 2010
1 answer
181 views
We have recently converted many of our reports to use the new Telerik reporting and Web Viewer.  While most of these reports are running fine, there are some time-out issues we are running into.  The issues deal with the amount of data being renderred on the report and the values returned.  I have checked and the Stored Procedure getting the data is returning in just a few seconds, so the issue is not with data retrieval from the database.  What I am seeing is the following:

  • Select the report we want to view.  This makes the postback call to the server to retrieve the data.
  • The page returns from the postback, and the ReportViewer has the 'processing' icon displayed inside the content area.
  • This 'processing' continues for a minute or so and then times out while trying to render the report.

I know the report being displayed contains a lot of data.  Is there any way to set the viewer to have additional properties to allow it to process longer?  Is it actually making an additonal postback or AJAX call to the server after the initial postback to generate the actual report or is that done on the client?  Are there other settings we can use to speed up rendering if there is a lot of data being returned?

Thanks.

Peter
Telerik team
 answered on 08 Jun 2010
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?