Telerik Forums
Reporting Forum
10 answers
1.4K+ views
Is it possible to change the background image on a report based on a parameter or value returned by a function ?

I want to apply a watermark type image on the report but want to change it dependant on the state of the document content i.e. if i had a function that returned a string of "Draft" i would want to apply the Draft image to the whole report likewise if the function returned "Approved" i would want to apply the Approved image instead?

Is this possible ? if so could someone explain how to achieve this. If this isnt possible is there any work arounds ?

Thanks  
Steve
Telerik team
 answered on 10 Aug 2011
2 answers
190 views
Hi

I have a very simple question : Is it possible to change the value of the label on the X Axis. In fact, what I want is to replace the number under the bar (bar chart) by a date (Look the attached file to see what I mean)? For me, it seem that it should be possible and really easy to do, but I look in the doc and it seem that only number can be set to the X axis label. So, is it right or is it a way to do what I want ?

Thank you,
David
David
Top achievements
Rank 1
 answered on 10 Aug 2011
1 answer
53 views
I have a report containing in section detail chart. If it is rendered to PDF (programmatically) all ok.
If render to a different format (rtf, docx, xls, xlsx, image), all charts are the same as in the last record.
Using Telerik Reporting Q2 2011.
Steve
Telerik team
 answered on 10 Aug 2011
1 answer
146 views
I have a ReporViewer and a bunch of reports.  There are a couple reports where I don't want the toolbar visible. (reportViewer.ToolbarVisible = false).  When switching reports in code, I can set the visibility of the toolbar just fine. But I can't figure out how to set the visibility when switching reports using either the navigation buttons (forward/back) or when a report is viewed by clicking on a link (textbox with Navigate action) in another report.

Is there a way to set the ReportViewer's ToolbarVisibility from within a report?  Or is there an event in the ReportViewer that fires when the Report property is changed?

Thanks,
Justin
Steve
Telerik team
 answered on 10 Aug 2011
0 answers
175 views
I have a report that takes a single parameter and uses that in an ObjectDataSource to query data for the report. I would like to embed that report in the detail section of a master report, which accepts an array of int's as a multivalue parameter. Each element of the parameter array would be passed to the subreport. That way I would get a set of pages, each a subreport. I haven't found an example of how to set this up. Any help would be appreciated.

Steve
neebs
Top achievements
Rank 2
 asked on 10 Aug 2011
9 answers
344 views
how can I make a report using a sqldatasoure? I have to pass a parameter with the Id I want to use to get the data I need. How can I do that.

thanks
Brandon
Top achievements
Rank 1
 answered on 09 Aug 2011
1 answer
214 views
I'm not sure what's going wrong, but when I set my query programatically, it's not seeing @myParameter is passed into the DataSource.

On the datasource on my designer, I'm making the parameter as a string and hardcoding it for debugging.  But when I my query runs, the @myParameter passed in is blank.

I'm using a binding on the report on the DataSource and send it to:

 

 

public static SqlDataSource ChangeConnectionString(object reportItem, int zoneNo)

 

{


dataSource.SelectCommand = ...the query with my parameter



I set the connection and the query string.  The query string works fine, if I take away the @myParameter.

I have another report where I do the same thing and it's working fine.  Everything looks the same, but one sets the parameter in the query and the other doesn't.  Anything I should do to debug?  It's really hard because I can't put breakpoints in the code behind.
danparker276
Top achievements
Rank 2
 answered on 09 Aug 2011
1 answer
69 views
Hello,
hi have  a pie chart in my repor. I have changed some PlotArea Properties and some chart controlo properties.
All changes  are visible at design time but :

1) if i compile and execute the program  (webForm) i see the starting layout of the pie chart. That is all changes i edited are gone.
2) if i close the solutione and then i re.open it  alle changes are gone too. (i saved before to close)

BTW, in the tool box  i see the list of telerik controls, but it is  repeated several times. Lik e if the controlslist was appended to itsself several times (it seems to be alist for every time i have installed telerik )

My IDE si VS2010 c#

thanks
Peter
Telerik team
 answered on 09 Aug 2011
2 answers
114 views

Hi,

I'm wondering whether nullable types are supported? I'm trying to make a binding using a nullable field and the desinger correclty displays the subcategories "HasValue" and "Value" of the field.
However I'm not able to make a binding against the HasValue instead what I have had to do is use the Is Null on the field itself, likewise I get an error if I try to display Field.Value in a report.

Tomas

Peter
Telerik team
 answered on 09 Aug 2011
3 answers
120 views
on the web form, the parameter holds, but on the reporting library, it does not. what am i dont wrong here?

CampRegistration.vb

   Public Sub New()
        InitializeComponent()

        'Me.ReportParameters("campdateid").Value = 7 'default here

        Me._campdateid = Me.ReportParameters("campdateid").Value

        'Me.TextBox1.Value = Me.ReportParameters("campdateid").Value.ToString


        Me.cdbll.connectionString = bo.Constants.ConnectionString
        Me.rbll.connectionString = bo.Constants.ConnectionString
        
    End Sub

    Private _campdateid As Integer = 0

    Private _contactlist As System.Data.DataTable = Nothing

    Private cdbll As New dal.CampDate()
    Private rbll As New dal.Registration

    Private _registrations As DataTable = Nothing



    

    'Private Sub SubReport1_NeedDataSource(ByVal sender As Object, ByVal e As System.EventArgs) Handles SubReport1.NeedDataSource
    '    Dim subReportItem As Telerik.Reporting.Processing.SubReport = TryCast(sender, Telerik.Reporting.Processing.SubReport)


    '    subReportItem.InnerReport.DataSource = Me._contactlist
    'End Sub

 
    Private Sub CampRegistration_NeedDataSource(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.NeedDataSource

        ' Exit Sub

        '---initial title of report
        Dim cd As acmilan.bo.CampDate = cdbll.getCamp(Me._campdateid)

       

        If cd IsNot Nothing Then
            Me.TextBox1.Value = cd.name & " @ " & cd.city & ", " & cd.state
            Me.TextBox3.Value = cd.start.ToLongDateString & " to " & cd.end.ToLongDateString
        End If
        
        Try

            '---get registrations for campdate
            Me._registrations = Me.rbll.getAllForCampDate(Me._campdateid)
            TryCast(sender, Telerik.Reporting.Processing.Report).DataSource = Me._registrations


             
        Catch ex As Exception
            'Me.TextBox1.Value = ex.StackTrace & ex.Message
        End Try


    End Sub


Report.aspx.vb
  Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgsHandles Me.Load
        If Not IsPostBack Then
            Dim repReport As New thunder.apps.acmilan.reports.CampRegistration
            Dim cdbll As New bll.CampDate(thunder.framework.dal.sql.DataAccess.rMethod.ObjectList)


            Dim id As Integer = Convert.ToInt32(Request.QueryString("campdateid"))
            Dim cd As bo.CampDate = cdbll.getCampdate(id)

            If cd IsNot Nothing Then
                Me.HyperLink1.NavigateUrl = "campprofile.aspx?campid=" & cd.campid.ToString
                repReport.DocumentName = cd.name & "Camp_Registration_Report_" & id.ToString
                repReport.ReportParameters("campdateid").Value = id

                Me.ReportViewer1.Resources.ProcessingReportMessage = "Generating Camp Registration ID" & repReport.ReportParameters("campdateid").Value.ToString

                Me.ReportViewer1.Report = repReport
                Me.ReportViewer1.DataBind()
                Me.ReportViewer1.RefreshReport()



            Else

            End If

        End If
    End Sub


Steve
Telerik team
 answered on 09 Aug 2011
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?