Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL forum
Answered

Report Template Storage Location

Posted on by 195

Good afternoon,

I have a user whose manager left the company and she would like to get a report for which it is likely that he used a non-public template.  Is there somewhere I can go as an admin to find all of those templates to see if I can find the one she is looking for?

Thank you!

  • Suggested answer
    Mark E Profile Picture
    Mark E 6,405 on at
    RE: Report Template Storage Location

    --Run the following script against the System DB

    Declare @statement as nvarchar(4000)

    Declare @startposition as varchar(100)

    Declare @smarttext varchar(8000)

    Declare @i as integer

    Declare @TemplateID char(30)

    Declare @ScrnNbr char(5)

    -- ====================================

    -- set the TemplateID that you are looking for

    SET @TemplateID = 'XXXXXXXXXXXXXXXXXX'

    -- set the ScrnNbr of the Template ID (in case there are more than 1 Template with the same ID)

    SET @ScrnNbr = 'XXXXX'

    -- ====================================

    Set @i =1

    Set @smarttext =''

    While @i < 1000000

    Begin

    Set @smarttext = @smarttext +

    -- we need to convert the Image to varbinary, then to varchar

    -- the result of the two conversions is LTrim-ed & RTrim-ed

    -- it is converted in 100 char chunks - each of which is

    -- separately Selected from the Template table

    (Select Substring(LTrim(RTrim(

    Convert(varchar(8000), Convert(varbinary(8000), SmartText))

    )

    ),@i,100)

    From Template

    Where TemplateId = @TemplateID

    AND ScrnNbr = @ScrnNbr

    )

    Set @i = @i +100

    End

    -- Using PRINT obeys cr/lf chars which are presumably in the data

    Print @smarttext

  • DUB Profile Picture
    DUB on at
    RE: Report Template Storage Location

    I would love to have the script that decrypts the temp SmartText field.  Can you share that/

  • Shaun Fortune Profile Picture
    Shaun Fortune 195 on at
    RE: Report Template Storage Location

    Thank you so much, Elaine.  It worked!!  I really appreciate your assistance.

    Have a great week!

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Report Template Storage Location

    There is a template table in the system dbase.  It is private is it has a userid.  So to clear all userIDs and make all templates public, you could run this script.

    update Template set UserId = ''

  • Shaun Fortune Profile Picture
    Shaun Fortune 195 on at
    RE: Report Template Storage Location

    I would love to use it.  It will save me a lot of time!

  • Suggested answer
    Mark E Profile Picture
    Mark E 6,405 on at
    RE: Report Template Storage Location

    The only way to locate/review the Templates is to query the Template table in the System database, where the UserID field <> '' (any Template with a UserID is Private).

    But the details of the Template itself are stored in SmartText format, so you won't be able to read it...

    I have a query that will decode the contents of any Template if you want to use it....

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,558 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,647 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans