Telerik Forums
Reporting Forum
4 answers
169 views
Hello, i want to print report pragmaticaly from silverlight... i already have code:

 private void OnPrintButtonClick(object sender, RoutedEventArgs e)
        {
            PrintDocument pd = new PrintDocument();
            Collection<Canvas> pagesList = new Collection<Canvas>();
            Model.PageRoot.UpdateLayout();
            pagesList.Add((Canvas)Model.PageRoot);
            while (Model.PageNumber < Model.PageCount)
            {
                Model.MoveToNextPageCommand.Execute(null);
                Model.PageRoot.UpdateLayout();
                pagesList.Add((Canvas)Model.PageRoot);
            }
        
            int index = 0;
            pd.PrintPage += (s, arg) =>
            {
                if (index >= pagesList.Count)
                {
                    arg.HasMorePages = false;
                    return;
                }
                arg.PageVisual = pagesList.ElementAt(index);
                arg.HasMorePages = true;
                index++;
            };
            pd.Print("");
        }

but when i use  Model.MoveToNextPageCommand.Execute(null); PageRoot is not updated and i have the same page each time... can you help me? how can i go through pages and collect data in images array for print them next? what should i do to update pageroot?
danparker276
Top achievements
Rank 2
 answered on 07 Apr 2011
1 answer
126 views
I'm looking for an example of how to bind a char to a generic list of first names and last names. My list looks like the following:
public class Names
{
    public string FirstName;
    public string LastName;
}

After gathering my data I create a list of Names
List<Names>ABunchOfNames = new List<Names>();

My list is populated, I see all of the names in the list...

I then set the datasource of the table to the List:
myTable.Datasource = ABunchOfNames;

When I look at the datasource during debug, I can see that my list is in there...  When I let the report finish I get the following errors:
"An error has occurred while processing Textbox 'textbox19': The expression contains object 'FirstName' that is not defined in the current context.

I get the same thing for LastName...

I am using Q2 2009 Telerik reporting due to the hoops I have to jump through to make the slightest of changes of architecture...  Any help? 

Thanks.
Lonnie
Top achievements
Rank 2
 answered on 07 Apr 2011
3 answers
185 views
Hi,

Is there a way that I can hide a column of a certain table when exporting to pdf?

Im using Q1 with silverlightviewer, so I need the report to be generated while I click the pdf in silverlight viewer.


Regards
Bill
Steve
Telerik team
 answered on 07 Apr 2011
7 answers
730 views
When i deploy my app on web server (app was running ok on my local pc) telerik reports are not open
it gives me 3 error 'Unexpected token < ' , ReportViewer is undefined in  chrome
and ReportViewer is undefined error in IE
I view following thread to solve this probelm
Telerik.ReportViewer missing in IIS - works with dev-webserver

and try to resolve but still the problem persist
here is my web.config file
<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
  <configSections> 
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/> 
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
          <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> 
        </sectionGroup> 
      </sectionGroup> 
    </sectionGroup> 
  </configSections> 
   
  
   
  <system.web> 
    <!--  
            Set compilation debug="true" to insert debugging  
            symbols into the compiled page. Because this  
            affects performance, set this value to true only  
            during development. 
        --> 
    <compilation debug="true" defaultLanguage="c#"
      <assemblies> 
        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
        <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
        <!--<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>--> 
        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
 
        <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
        <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> 
        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
        <add assembly="Telerik.Web.UI, Version=2009.3.1208.35, Culture=neutral, PublicKeyToken=121FAE78165BA3D4"/> 
       <!-- <add assembly="Telerik.Reporting, Version=3.2.9.1211, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/> 
        <add assembly="Telerik.ReportViewer.WebForms, Version=3.2.9.1211, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"></add> 
        --> 
        <add assembly="Telerik.Reporting, Version=4.0.10.317, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"/> 
        <add assembly="Telerik.ReportViewer.WebForms, Version=4.0.10.317, Culture=neutral, PublicKeyToken=A9D7983DFCC261BE"></add> 
      </assemblies> 
 
    </compilation> 
    <!-- 
            The <authentication> section enables configuration  
            of the security authentication mode used by  
            ASP.NET to identify an incoming user.  
        --> 
    <authentication mode="Windows"/> 
    <sessionState mode="InProc" cookieless="false" timeout="60"/> 
    <!-- AUTHORIZATION 
            This section sets the authorization policies of the application. You can allow or deny access to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous (unauthenticated) users. 
        --> 
    <authorization> 
      <allow users="*"/> 
    </authorization> 
 
    <!-- 
            The <customErrors> section enables configuration  
            of what to do if/when an unhandled error occurs  
            during the execution of a request. Specifically,  
            it enables developers to configure html error pages  
            to be displayed in place of a error stack trace. 
 
        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"
            <error statusCode="403" redirect="NoAccess.htm" /> 
            <error statusCode="404" redirect="FileNotFound.htm" /> 
        </customErrors> 
        --> 
    <customErrors mode="Off"/> 
    <pages> 
      <controls> 
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      </controls> 
    </pages> 
    <httpHandlers> 
      <remove verb="*" path="*.asmx"/> 
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/> 
      <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false"/> 
      <add path="Telerik.ReportViewer.axd" verb="*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=4.0.10.317, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" validate="true" /> 
    </httpHandlers> 
    <httpModules> 
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add name="RadCompression" type="Telerik.Web.UI.RadCompression" /> 
    </httpModules> 
  </system.web> 
  <system.codedom> 
    <compilers> 
      <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        <providerOption name="CompilerVersion" value="v3.5"/> 
        <providerOption name="WarnAsError" value="false"/> 
      </compiler> 
    </compilers> 
  </system.codedom> 
  <!--  
        The system.webServer section is required for running ASP.NET AJAX under Internet 
        Information Services 7.0.  It is not necessary for previous version of IIS. 
    --> 
  <system.webServer> 
    <validation validateIntegratedModeConfiguration="false"/> 
    <modules> 
      <remove name="ScriptModule"/> 
      <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add name="RadCompression" type="Telerik.Web.UI.RadCompression" /> 
    </modules> 
    <handlers> 
      <remove name="WebServiceHandlerFactory-Integrated"/> 
      <remove name="ScriptHandlerFactory"/> 
      <remove name="ScriptHandlerFactoryAppServices"/> 
      <remove name="ScriptResource"/> 
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> 
      <add name="Telerik.Web.UI.WebResource" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI"/> 
      <add name="Telerik.ReportViewer.axd_*" path="Telerik.ReportViewer.axd" verb="*" type="Telerik.ReportViewer.WebForms.HttpHandler, Telerik.ReportViewer.WebForms, Version=3.2.9.1211, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" preCondition="integratedMode,runtimeVersionv2.0" /> 
    </handlers> 
    <defaultDocument> 
      <files> 
        <clear/> 
        <add value="Default.htm"/> 
        <add value="default.aspx"/> 
        <add value="Default.asp"/> 
        <add value="index.htm"/> 
        <add value="index.html"/> 
        <add value="iisstart.htm"/> 
      </files> 
    </defaultDocument> 
  </system.webServer> 
  <runtime> 
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
      <dependentAssembly> 
        <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/> 
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> 
      </dependentAssembly> 
      <dependentAssembly> 
        <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/> 
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> 
      </dependentAssembly> 
    </assemblyBinding> 
  </runtime> 
</configuration> 

Mridul
Top achievements
Rank 1
 answered on 07 Apr 2011
1 answer
141 views
I'm wondering the best way to do this.  Also I'm using silverlight report viewer so I can't give the reports the dataset.

I basically want to make the selectCommand dynamic like
Select a,b,c from tableA where d=1
if @paramter1="Z" then add " and z=1 "  to the query
Select a,b,c from tableA where d=1 and z=1

I could do this by stored procedure, but I'd rather not add another stored procedure to my database.
I could use filters, but I'm going to get too many rows back.

Can I make another SQL DataSource and bind it to my Report based on a parameter I send in?
Can I use iff() in the selectCommand ?

Using a stored procedure will work ok for me.  Just wondering if there's another way.
danparker276
Top achievements
Rank 2
 answered on 06 Apr 2011
1 answer
89 views
Hello,

I have a couple of pictureboxes in my report.  I programmatically bind an image file to a picturebox object using the following code.

pictureBox_Specimen1.Value = System.Drawing.

Image.FromFile(sketchpath.Path);

 


Before the report is created/displayed I can modify the image located at sketchpath.path.  After I open the report and then close it, I am no longer able to perform any IO on the image until I restart my application.

How do I have the report release the image resource?

In the report dispose event I have set the picturebox value to null and this does not help.

Any help would be greatly appreciated!
Shawn
Top achievements
Rank 1
 answered on 06 Apr 2011
1 answer
304 views

Instead of just generating report we want our customer to design their report layout themselves (just like the telerik report designer add-on for Visual studio 2010). Is it possible for us to get/buy your report designer so that user can drag and drop what they want in Silverlight.

Thank you.

Peter
Telerik team
 answered on 06 Apr 2011
2 answers
176 views
I'm evaluating Telerik Reporting at the moment to see if it fits our needs for our WPF based application and would like to ask a few questions:

- In your "Known Limitations" stickied post you mention that a "search" feature is not implemented yet. Does that mean there is no support for text search (think ctrl+f like search) in the report viewer so that users can search for specific text strings? If true, can you give me an idea when you are planning to implement this feature? This feature is very important for us because we have some large reports where users sometimes look for specific text items and would be lost without a proper search function.

- Is it possible to hide the toolbar in the WPF viewer and implement our own controls for "next page", "print" etc.? Does the WPF report viewer support WPF command bindings for these functions?

- Going a step further from the previous question: In what extend does Telerik Reporting support the WPF binding engine? I mentioned command bindings for the viewer but can you give me some more details on this topic and/or future plans?

Many thanks!
Owen
Top achievements
Rank 1
 answered on 06 Apr 2011
1 answer
81 views

Hi,

I'm using a demo version of telerik reporting 4.1.10.921, the demo is working very well, we have a report with an image inside, we need to change this image for another one.
In my local machine is working, the image was changed, but, when I publish (by the way, I'm using visual studio 2010 with SL4 and WCF services) the image doesn't change, I delete the project completely from the server, I create the project again... and nothing changed, I don't know what to do, and I don't know from where is getting the previous image.
There are no problems of configuration, the report is working well it's just the image that is wrong.

Any idea?
Thanks a lot.
Chris Thierry
Top achievements
Rank 1
 answered on 06 Apr 2011
2 answers
541 views
Hi,

I Got some problems with the reportviewer.

Error:
Server Error in '/AjaxWebInterface' Application.
Entry point was not found.
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.EntryPointNotFoundException: Entry point was not found.
 
Source Error:
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
 
Stack Trace:
 
[EntryPointNotFoundException: Entry point was not found.]
   Telerik.Reporting.IReportDocument.get_ReportParameters() +0
   Telerik.ReportViewer.WebForms.ReportViewer.get_HasParams() +127
   Telerik.ReportViewer.WebForms.ReportViewer.SetParamControlsVisibility() +46
   Telerik.ReportViewer.WebForms.ReportViewer.OnPreRender(EventArgs e) +47
   System.Web.UI.Control.PreRenderRecursiveInternal() +80
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
 
 
Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927


My code ReportViewer.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ReportViewer.aspx.cs" Inherits="ReportViewer" %>
 
<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=4.0.10.423, Culture=neutral, PublicKeyToken=a9d7983dfcc261be"
    Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div id="Div1" style="vertical-align: top; height: 80px; background-image: url(<%= ResolveClientUrl("~/img") %>/logo.png);
        background-position: right; background-repeat: no-repeat">
        <asp:Panel runat="server" ID="DashboardPanel">
        </asp:Panel>
    </div>
    <div>
        <telerik:ReportViewer ID="ReportViewer1" runat="server" Width="100%" Height="100%">
        </telerik:ReportViewer>
    </div>
    </form>
</body>
</html>

ReportViewer.aspx.cs
public partial class ReportViewer : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ReportViewer1.Report = PluginManager.Instance.GetReport("TagByAllRegionsByYear");
    }
}
Kanhaiya
Top achievements
Rank 1
 answered on 06 Apr 2011
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?