Error with Guid parameter in report

7 posts, 0 answers
  1. Stanislav Dudnyk
    Stanislav Dudnyk avatar
    7 posts
    Member since:
    May 2010

    Posted 19 Jul 2010 Link to this post

    I have two input parameters type of Guid.
    I set default values for parameters like d6a0d1a8-0d5d-4850-9930-5670dfa26403 or 'd6a0d1a8-0d5d-4850-9930-5670dfa26403'

    When report preview I have error : Failed to convert parameter value from a string to Guid.

    What is wrong?
  2. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 20 Jul 2010 Link to this post

    Hello Stanislav Dudnyk,

    Unfortunately our Report Parameters don't support GUID value types. Our suggestion would be to use a string parameter and with a Convert() function to change the parameter type to uniqueidentifier.

    I have attached a sample report that shows how to accomplish your task. To run the sample project you will need the AdventureWorks database that comes with Telerik Reporting installation.

    The SqlDataSource2 is using a Select statement as the one shown in the following code snippet:
     
    Select Name From Production.Product WHERE rowguid=(SELECT Convert(uniqueidentifier,@RowGuid))
     
    For more information check out Adding Parameters to Report help article.

    Best wishes,
    Peter
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Stanislav Dudnyk
    Stanislav Dudnyk avatar
    7 posts
    Member since:
    May 2010

    Posted 20 Jul 2010 Link to this post

    Thanks!
  5. Stanislav Dudnyk
    Stanislav Dudnyk avatar
    7 posts
    Member since:
    May 2010

    Posted 21 Jul 2010 Link to this post

    What about stored procedure with uniqueidentifier parameter and I can't use text command or other stored?
  6. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 22 Jul 2010 Link to this post

    Hi Stanislav Dudnyk,

    You can use the same approach in Stored Procedures. Check out the following sample stored procedure:

    CREATE PROCEDURE [dbo].[UsingGUID]
    @RowGuid char(36)
    AS
    BEGIN
            Select Name From Production.Product WHERE rowguid=(SELECT Convert(uniqueidentifier,@RowGuid))
    END

    Sincerely yours,
    Peter
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Jonathan
    Jonathan avatar
    57 posts
    Member since:
    Jun 2012

    Posted 22 Apr 2011 Link to this post

    Is there no way to use Guids in the parameters? We are transitioning from SQL reporting to telerik and just want to reuse the stored procedures. In SQL reporting it accepts Guids, I would prefer not to make a copy of our stored procs with the parameters as strings because we have about 300 reports to build.
  8. Massimiliano Bassili
    Massimiliano Bassili avatar
    323 posts
    Member since:
    May 2006

    Posted 22 Apr 2011 Link to this post

    searching before asking is gold: http://www.telerik.com/support/kb/reporting/designing-reports/guid-as-report-datasource-parameter-type.aspx

    Cheers!
Back to Top
DevCraft banner