Showing posts with label errors. Show all posts
Showing posts with label errors. Show all posts

Wednesday, March 28, 2012

Report Parameter Errors

Hello.

I've been trying to figure this out for a day now and am getting frustrated. (ARGH!) As shown below, I have 4 parameters in my sproc. The @.Action is being set as "getAll", the @.FormID is coming from a textbox control, and the other 2 should allow nulls (this is in Local mode in a Web Form). I keep getting the error message below.

I do have these params defined in my .rdlc, then I'm setting the param values in my form's code-behind.

What am I doing wrong?


CREATE PROCEDURE dbo.spFormResults
(
@.Action VarChar( 20 ),
@.ResultID INT = NULL,

@.FormID int = NULL,

@.Data text = NULL
)
AS

.....


string strAction = "getAll";

ReportParameter actionParam = new ReportParameter("Action", strAction, false);

ReportParameter resultIDParam = new ReportParameter("ResultID", "0", false);

ReportParameter formIDParam = new ReportParameter("FormID", txtFormID.Text, false);

ReportParameter dataParam = new ReportParameter("Data", string.Empty, false);

this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { actionParam, resultIDParam,

formIDParam, dataParam });

this.ReportViewer1.LocalReport.Refresh();


An error has occurred during report processing.

  • Exception has been thrown by the target of an invocation.
  • Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

    To me it seems you are looking in the wrong place for the error. It looks like the sort of error message that actually comes from the database, not RS. You need to check whether some of the columns you are searching on are set to NOT NULL in the schema.

    HTH,

    sluggy

    |||

    Yes, I thought that might be the case, too, but when I looked at it in the debugger, none of the parameters had values in them -- even though I was setting them in my code. So I'm still thinking the values of the params aren't being set somehow.

  • Tuesday, March 20, 2012

    Report Manager Unavailable

    Installed SRS 2k on a Windows 2003 sp2 machine.
    SQL 2k installed, running, Report Server databased got created.
    No errors during installation but two odd issues came up.
    First, we can access the reportserver page via http://localhost/reportserver
    but Report Manager via http://localhost/reports errors with a 404
    (with report manager color scheme). It does append the /pages/
    folder.aspx to the typed address.
    Event viewer does show an Report Manager Event 114 which appears to
    equate to "Report Manager cannot connect to the ReportServer service"
    checked and the SRS service is running.
    Not sure what else to look for.
    Second and maybe related: http://localhost/reportserver works but
    http://servername/reportserver is not recognized - it goes to an under
    construction page. The RSWebApplication.config file has
    <ReportServerUrl>http://SERVERNAME/ReportServer</ReportServerUrl>
    I can ping localhost, servername and IP address with success.
    Have uninstalled SRS, removed databases and reinstalled same issues.
    Any ideas? Thanks for your help.Just in case it helps somebody down the road...
    Problem was another website on the server using port 80. Change web
    site report manager was using to a different port via IIS and it
    worked.
    http://webservername:99/reports

    Wednesday, March 7, 2012

    Report is blank, but QA returns results

    I've tested a query in Query Analyzer and it returns the desired results.
    However, the same query in a SQL report finishes without errors but the
    report is completely blank. Similarly formatted reports work fine. Here's the
    query:
    SELECT CRMAF_Task.modifiedonutc, CRMAF_Task.modifiedbyname,
    CRMAF_Task.owneridname, CRMAF_Task.subject, CRMAF_Task.statecodename,
    CRMAF_Task.description, CRMAF_Task.regardingobjectid,
    CRMAF_Notes.subject AS NotesSubj, CRMAF_Notes.notetext AS NoteText,
    CRMAF_Notes.createdonutc
    FROM FilteredTask CRMAF_Task LEFT JOIN
    FilteredAnnotation CRMAF_Notes ON
    CRMAF_Task.activityid = CRMAF_Notes.objectid
    WHERE (CRMAF_Task.subject LIKE '%reb%') AND
    (CRMAF_Task.regardingobjectid = 'D5C79CEC-D3AF-DB11-86DF-0003FFDAF900') AND
    (CRMAF_Task.statecode = 1)
    Anyone have any ideas?
    --
    Matt Wittemann, CRM MVP
    http://icu-mscrm.blogspot.comOn Feb 19, 6:12 pm, MattNC <Mat...@.discussions.microsoft.com> wrote:
    > I've tested a query in Query Analyzer and it returns the desired results.
    > However, the same query in a SQL report finishes without errors but the
    > report is completely blank. Similarly formatted reports work fine. Here's the
    > query:
    > SELECT CRMAF_Task.modifiedonutc, CRMAF_Task.modifiedbyname,
    > CRMAF_Task.owneridname, CRMAF_Task.subject, CRMAF_Task.statecodename,
    > CRMAF_Task.description, CRMAF_Task.regardingobjectid,
    > CRMAF_Notes.subject AS NotesSubj, CRMAF_Notes.notetext AS NoteText,
    > CRMAF_Notes.createdonutc
    > FROM FilteredTask CRMAF_Task LEFT JOIN
    > FilteredAnnotation CRMAF_Notes ON
    > CRMAF_Task.activityid = CRMAF_Notes.objectid
    > WHERE (CRMAF_Task.subject LIKE '%reb%') AND
    > (CRMAF_Task.regardingobjectid = 'D5C79CEC-D3AF-DB11-86DF-0003FFDAF900') AND
    > (CRMAF_Task.statecode = 1)
    > Anyone have any ideas?
    > --
    > Matt Wittemann, CRM MVPhttp://icu-mscrm.blogspot.com
    That's a tough one. Have you tried refreshing the dataset and making
    sure that you are not filtering out anything (if you're grouping in
    the report)?
    Enrique Martinez
    Sr. SQL Server Developer|||In two things it should be empty.
    1. If no error, but empty it means it is not satisfying the where
    conditions. So just check the where conditions may be spelling etc...
    2. you said the same query works in QA, then just check and re-check where
    your datasource is connecting, is it pointing to the same database/table
    where your QA also connects ' just check this.. I think that must be wrong...
    Amarnath
    "MattNC" wrote:
    > I've tested a query in Query Analyzer and it returns the desired results.
    > However, the same query in a SQL report finishes without errors but the
    > report is completely blank. Similarly formatted reports work fine. Here's the
    > query:
    > SELECT CRMAF_Task.modifiedonutc, CRMAF_Task.modifiedbyname,
    > CRMAF_Task.owneridname, CRMAF_Task.subject, CRMAF_Task.statecodename,
    > CRMAF_Task.description, CRMAF_Task.regardingobjectid,
    > CRMAF_Notes.subject AS NotesSubj, CRMAF_Notes.notetext AS NoteText,
    > CRMAF_Notes.createdonutc
    > FROM FilteredTask CRMAF_Task LEFT JOIN
    > FilteredAnnotation CRMAF_Notes ON
    > CRMAF_Task.activityid = CRMAF_Notes.objectid
    > WHERE (CRMAF_Task.subject LIKE '%reb%') AND
    > (CRMAF_Task.regardingobjectid = 'D5C79CEC-D3AF-DB11-86DF-0003FFDAF900') AND
    > (CRMAF_Task.statecode = 1)
    > Anyone have any ideas?
    > --
    > Matt Wittemann, CRM MVP
    > http://icu-mscrm.blogspot.com|||Who are you running the query as in QA?
    Since you are using filtered views, if you are not running as the same
    user running the reports, it may be an issue of security.
    On Feb 19, 7:12 pm, MattNC <Mat...@.discussions.microsoft.com> wrote:
    > I've tested a query in Query Analyzer and it returns the desired results.
    > However, the same query in a SQL report finishes without errors but the
    > report is completely blank. Similarly formatted reports work fine. Here's the
    > query:
    > SELECT CRMAF_Task.modifiedonutc, CRMAF_Task.modifiedbyname,
    > CRMAF_Task.owneridname, CRMAF_Task.subject, CRMAF_Task.statecodename,
    > CRMAF_Task.description, CRMAF_Task.regardingobjectid,
    > CRMAF_Notes.subject AS NotesSubj, CRMAF_Notes.notetext AS NoteText,
    > CRMAF_Notes.createdonutc
    > FROM FilteredTask CRMAF_Task LEFT JOIN
    > FilteredAnnotation CRMAF_Notes ON
    > CRMAF_Task.activityid = CRMAF_Notes.objectid
    > WHERE (CRMAF_Task.subject LIKE '%reb%') AND
    > (CRMAF_Task.regardingobjectid = 'D5C79CEC-D3AF-DB11-86DF-0003FFDAF900') AND
    > (CRMAF_Task.statecode = 1)
    > Anyone have any ideas?
    > --
    > Matt Wittemann, CRM MVPhttp://icu-mscrm.blogspot.com