Showing posts with label dynamicly. Show all posts
Showing posts with label dynamicly. Show all posts

Wednesday, March 7, 2012

Dynamic datasource for RepoertViewer Problem

hi all,

i have a reportviewer in acsx file(controll).

i try to attach dynamicly it datasource in this way:

Protected Sub cmdGetReport_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles cmdGetReport.Click ReportViewer1.Visible =True Dim ObjectDataSource1As ObjectDataSource =New ObjectDataSource ObjectDataSource1.TypeName ="ReportDataSetTableAdapters.Contel_Enercon_RptInvoiceByAccountTableAdapter" ObjectDataSource1.SelectParameters.Clear()If cboAccountList.SelectedValue > 0Then ObjectDataSource1.SelectMethod ="GetInvoiceByAccount" ObjectDataSource1.SelectParameters.Add("SiteID", cboSiteList.SelectedValue) ObjectDataSource1.SelectParameters.Add("InvoiceID", cboInvoiceList.SelectedValue) ObjectDataSource1.SelectParameters.Add("AccountID", cboAccountList.SelectedValue)Else ObjectDataSource1.SelectMethod ="GetAllInvoiceBySite" ObjectDataSource1.SelectParameters.Add("SiteID", cboSiteList.SelectedValue) ObjectDataSource1.SelectParameters.Add("InvoiceID", cboInvoiceList.SelectedValue)End If Dim rdsAs ReportDataSource =New ReportDataSource rds.DataSourceId ="ObjectDataSource1" rds.Name ="ReportDataSet_Contel_Enercon_RptInvoiceByAccount" ReportViewer1.LocalReport.DataSources.Add(rds) ReportViewer1.LocalReport.Refresh()End Sub

but when i try to open the report i get this error msg:

The DataSourceID of the ReportDataSource 'ReportDataSet_Contel_Enercon_RptInvoiceByAccount' of the ReportViewer 'ReportViewer1' must be the ID of a control of type IDataSource. A control with ID 'ObjectDataSource1' could not be found.

any idea?

 Well I solved it.
 Instead :
 Dim rdsAs ReportDataSource =New ReportDataSource rds.DataSourceId ="ObjectDataSource1" rds.Name ="ReportDataSet_Contel_Enercon_RptInvoiceByAccount"
i wrote:Dim rdsAs ReportDataSource =New ReportDataSource("ReportDataSet_Contel_Enercon_RptInvoiceByAccount",ObjectDataSource1)
And it worked...

Friday, February 17, 2012

Dynamic background color when using Jump To

Is it possible to dynamicly change the background color of the row(s) in the
destination report when using Jump To. I have a report that users click a
value and it jumps to another report. Whatever value the user clicks on in
the source report I would like to highlight in the destination report so they
can easily view all of the detail records.Define another parameter in the inside report. Then use the parameter to set
the row background color...
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Shoeman" <Shoeman@.discussions.microsoft.com> wrote in message
news:7B5B3CCE-1519-48B9-BBE9-932509D431A8@.microsoft.com...
> Is it possible to dynamicly change the background color of the row(s) in
> the
> destination report when using Jump To. I have a report that users click a
> value and it jumps to another report. Whatever value the user clicks on
> in
> the source report I would like to highlight in the destination report so
> they
> can easily view all of the detail records.|||I actually have 1 report with 5 tables. How would I assign the value of the
item clicked to the parameter I created. I have created an expression for
the BackroundColor that I think will work if I could find a way to pass it
the value of the parameter.
=iif(Fields!MENU_NAME.Value = Parameters!Parameter2.Value, "Transparent",
"Blue")
"Wayne Snyder" wrote:
> Define another parameter in the inside report. Then use the parameter to set
> the row background color...
> --
> Wayne Snyder, MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> www.mariner-usa.com
> (Please respond only to the newsgroups.)
> I support the Professional Association of SQL Server (PASS) and it's
> community of SQL Server professionals.
> www.sqlpass.org
> "Shoeman" <Shoeman@.discussions.microsoft.com> wrote in message
> news:7B5B3CCE-1519-48B9-BBE9-932509D431A8@.microsoft.com...
> > Is it possible to dynamicly change the background color of the row(s) in
> > the
> > destination report when using Jump To. I have a report that users click a
> > value and it jumps to another report. Whatever value the user clicks on
> > in
> > the source report I would like to highlight in the destination report so
> > they
> > can easily view all of the detail records.
>
>