none
Parameters / credentials?

    Question

  • Hi,

       I'm getting an "A parameter or data source credential is missing a value. Prompting for this value has been disabled. Supply a value or enable prompting." error when I try to show a report in a Windows Form with Local Processing.

       The "ShowParametersPrompt" and "ShowCredentialsPrompt" are turned on, but maybe the problem is I don't have a way to "link" the datasource parameters (its a stored procedure tableadapter) with Report Parameters in the report designer, as there is no DataSource pane in the .rdlc designer?

       Also, I had to change to a filesystem path for the LocalReport property instead of using the ReportEmbeddedResource property, as it didnt seem to work (I get a "the definition for asdf.rdlc has not been provided" or a similar error msg).

       So the question is: How should I provide the parameter values or enable prompting for them when doing Local Processing?

    I've tried the following with no luck:

    InformeListaPrecios1TableAdapter ta = new InformeListaPrecios1TableAdapter();
    ta.Fill(
    this.precios1.InformeListaPrecios1, null, 5, null);

    this
    .reportViewer1.ProcessingMode = ProcessingMode.Local;
    this.reportViewer1.LocalReport.DisplayName = "<ns>.Report1.rdlc";
    this.reportViewer1.LocalReport.ReportEmbeddedResource = "<ns>.Report1.rdlc";
    this.reportViewer1.LocalReport.ReportPath = @"<fullpath>\Report1.rdlc";
    this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("asdf215ConnectionString", this.precios1.InformeListaPrecios1));

    //this.reportViewer1.LocalReport.SetParameters(??); I don't have ReportParams defined.

    this.reportViewer1.RefreshReport();


    Wednesday, May 04, 2005 3:26 AM

Answers

  • The error message needs improvement -- we are working on it. The most likely reason you are getting the error is because you haven't supplied a valid datasource instance. In the following line, make sure that "asdf215ConnectionString" exactly matches the name of the datasource expected by the RDLC. Open the RDLC file using Report Designer then from the Report menu choose Report Data Sources command. The dialog that opens will tell you the name that you should use.

    this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("asdf215ConnectionString", this.precios1.InformeListaPrecios1));
    Thursday, May 05, 2005 5:17 PM

All replies

  • The ReportViewer control does not prompt for parameters in local processing mode. Parameter prompting is only available when connected to a Report Server.

    In local processing mode, it is the host application's responsibility to execute queries, so it is the host application's responsibility to prompt for parameters, and set the parameter values during query execution. The ReportViewer control does not even need to know that you have query parameters. If the report has parameters that are not query parameters then you can supply the parameter values to the Report using the SetParameters method.

    The same goes for credentials. When connected to a Report Server the ReportViewer control prompts for data source credentials. But in local processing mode since it is the host applications responsibility to execute queries the ReportViewer control does not prompt for credentials.
    Wednesday, May 04, 2005 6:47 PM
  • Rajeev, first of all thanks for your quick response.

    I'm ok with that behavior, I even think its preferrable that you leave up to the user to fill the dataset. As you can see in the code I posted in the first message, I'm already doing that.

    So the question becomes, why do I get an error stating that prompting hasn't been enabled when it is in fact enabled (the properties are set to true), and prompting isn't even used in that processing mode, and why does it say parameters haven't been provided when I already filled the datasource and no parameters are needed?

    Thursday, May 05, 2005 1:03 AM
  • The error message needs improvement -- we are working on it. The most likely reason you are getting the error is because you haven't supplied a valid datasource instance. In the following line, make sure that "asdf215ConnectionString" exactly matches the name of the datasource expected by the RDLC. Open the RDLC file using Report Designer then from the Report menu choose Report Data Sources command. The dialog that opens will tell you the name that you should use.

    this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("asdf215ConnectionString", this.precios1.InformeListaPrecios1));
    Thursday, May 05, 2005 5:17 PM
  • Rajeev,

       Thanks. I wasn't aware of the new 'DataSources' menu item in the Report designer and I had looked into the raw xml of the rdlc file, and I thought the datasource name was "dbname215ConnectionString" (I edited the name in the code I posted for security reasons).
       Anyway, looking in the DataSources dialog gave me the correct name and that was it.

    Cheers,
    Juan

    Friday, May 06, 2005 4:10 PM
  • Hey.. I've had a play with the reports thing, it looks promising.
    One thing I can't get to work is having the thing show a report for each row in the datatable. It's supposed to do that right? I'd have 4 Rows in a DS, I pass it and it'll only show the first one.
    Am I missing something?

    Monday, May 09, 2005 3:15 PM
  • If you just drag a field into the report, then you'll only see the first row. Instead, add a Table or a List to the report, then drag your field into the Table or List.
    Monday, May 09, 2005 5:34 PM
  • Hi,

     When I look into .rdl file, I see all necessary information to get data from data datasource (connection string, select clause, etc.) Why do I need to specify the datasource programmatically, or in other words, is it possible to say the reportviewer this is your rdl file, do everything necessary and show me data?

    Thx...
    Wednesday, August 10, 2005 12:27 PM
  • I watched the video, but that used it with a desktop application. How do I use this locally. I don't have a SQL server running I can use.


    -Chris
    Thursday, August 18, 2005 7:57 PM
  • .RDL files contain all necessary information (connection string, select statement) to get data, but .RDLC files may or may not contain that information.

    You can use the ReportViewer control in two modes: Local processing mode and remote processing mode.

    In local mode, the ReportViewer control is designed to integrate well with Visual Studio data wizards and generated classes such as TableAdapter that connect to data sources, execute queries and fetch data. Such functionality is not duplicated in ReportViewer, so ReportViewer does not have the ability to connect to data sources, execute queries, or fetch data. (Building in such functionality would have limited ReportViewer's flexibility by limiting it to a known set of data providers.)

    In remote mode, ReportViewer connects to a Report Server, and displays reports that are processed and rendered by the Report Server. Report Server does have the ability to connect to data sources, execute queries, and fetch data. Once you deploy a report to Report Server, all you have to do is supply the URL of the Report Server and the path to the report to ReportViewer. So you can indeed say, "here is your rdl file, do everything necessary and show me data". Note that a free version of Report Server will be available in SQL Server Express.
    Monday, August 22, 2005 5:57 PM
  • Rajeev, I have a report I want to generate that will put one row at a time with info from other sources related to that row. I'm getting scope error. How do you do that. I can't even get first record to show because of scope area. My report does not need tables just row info and etc. then another row with same kind of data. Each session may run 8 or more lines of info before needing to skip to next record.
    Tuesday, September 13, 2005 3:17 PM
  • Hi Rajeev,

    I am newbie to VB 2005 and reportviewer. I have database driven application(ms access) with vb.net, and I want to generate report e.g monthly report (local mode)the user have to enter start/end date. so far what i know the there is no parameter prompting local mode, can you pls tell me how to do this. Its very urgent as i hav to sumbit a small project, only reporting is missing.

    thnks
    ritesh


    Monday, May 07, 2007 7:36 PM