Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.3k views
in Technique[技术] by (71.8m points)

reporting services - SSRS Table Cell Mailto link (Whether "Go to URL" Action or A HREF Link) duplicates and obscures table results?

I think I uncovered an actual, real Stack Overflow in SSRS Report Viewer/SSRS Report Builder:

In each of many of our SSRS reports, we had a table of upcoming actions and due dates. It was static, so I hyperlinked to the action numbers. All went well -- kind of useful.

But often we have to send reminders out to the responsible person, so I added a dynamic Mailto: link, that looked up all the items for the responsible person in the table and made up a reminder email, just by clicking their name.

="mailto:" & Fields!PERSONID.Value & "@Domain.com" & 
"?subject=You%20have%20" & IIf(LookupSet(Fields!PERSONID.Value, Fields!PERSONID.Value, Fields!TICKETID.Value, "DataSet1").Length<=1,"a%20","") & "AB" & IIf(LookupSet(Fields!PERSONID.Value, Fields!PERSONID.Value, Fields!TICKETID.Value, "DataSet1").Length>1,"s","") & "%20due%20within%203%20days" 
& "&body=" & Fields!DISPLAYNAME.Value & "%2C%0D%0A%0D%0A" 
& "You%20have%20" & IIf(LookupSet(Fields!PERSONID.Value, Fields!PERSONID.Value, Fields!TICKETID.Value, "DataSet1").Length<=1,"a%20","") & "AB" & IIf(LookupSet(Fields!PERSONID.Value, Fields!PERSONID.Value, Fields!TICKETID.Value, "DataSet1").Length>1,"s","") & "%20on%20the%203-Day%20List%3A%0D%0A%0D%0A" 
& Uri.EscapeDataString(Join(LookupSet(Fields!PERSONID.Value, Fields!PERSONID.Value, Fields!strReminder.Value, "DataSet1"), " " & Chr(13) & Chr(10)))
& "%0D%0A%0D%0A" 
& "To%20see%20your%20items%3A%20%0Ahttps%3A%2F%2FMy123ABs.Domain.com%0Ahttps%3A%2F%2FMy123BCs.Domain.com%0Ahttps%3A%2F%2FMy123CDs.Domain.com%0A"

But, as soon as I added the "Go To URL" Action with the long mailto: link, the report starts showing duplicate rows, and omits other rows.

So, I removed the "Go To URL" Action and instead set the placeholder expression to show HTML, and made the formula output an

<A HREF="(Same Mailto URL as above)">Indiv Name</A>

where again the link works fine buy duplicate rows are replacing other rows that should be included...

So, does SSRS have some sort of overflow bug with long URLs? Or did I miss something?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Documentation at https://docs.microsoft.com/en-us/sql/reporting-services/report-design/report-builder-functions-lookupset-function?view=sql-server-ver15 should be amended:

In SSRS, running Lookup() / LookupSet() queries against the same dataset that is being currently rendered in a Tablix causes duplicates and/or omissions. One workaround to prevent duplicates and omissions is to pass a copy of the dataset and run Lookup() or LookupSet() queries against ONLY that copy.

What got me was that SSRS hides this by prioritizing Lookup() or LookupSet() over rendering the Tablix, so that the Lookup() or LookupSet() usually developed and tested last works, but the existing table suffers duplicates and omissions.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...