Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Lakshmanan1
Helper I
Helper I

XML parameter not working in embed paginated report URL

Hi, I am trying to pass xml as parameter in embed url as rp variable  though my asp.net framework application level.  

Please can you help me  with this. 

 

string P_ID = '<Pr><id>25</id><id>32</id></Pr>';

string parameters = $"&rp:P_IDS={P_ID}&rp:START_DATE={START_DATE}&rp:END_DATE={END_DATE}";
EmbedUrl = embedInfo.embedUrl + parameters;

 

Lakshmanan1_0-1753269588183.png

 

2 REPLIES 2
SolomonovAnton
Super User
Super User

Why the raw XML fails

  • Characters such as <, >, & and quotes have reserved meanings in a URL. They must be percent-encoded; otherwise the service truncates or rejects the query-string.
  • Paginated Report parameters are always received as plain text. If you send an XML fragment you’ll parse it later in the dataset/query.

Recommended approach

  1. In the report:
    • Create parameter P_IDS as type Text, allow blank.
    • Inside the dataset (SQL Server example) turn the string back into XML:
      DECLARE @xml xml = @P_IDS;
      SELECT x.i.value('.', 'int') AS ID
      FROM   @xml.nodes('/Pr/id') x(i);
              
  2. In ASP.NET (Framework) encode the parameter value before concatenating it to the embedUrl:
using System.Web;   // for HttpUtility

var pIdXml   = "<Pr><id>25</id><id>32</id></Pr>";
var start    = startDate.ToString("yyyy-MM-dd");   // format counts!
var end      = endDate.ToString("yyyy-MM-dd");

var query =
    $"rp:P_IDS={HttpUtility.UrlEncode(pIdXml)}" +
    $"&rp:START_DATE={start}" +
    $"&rp:END_DATE={end}";

var embedUrlWithParams = $"{embedInfo.embedUrl}?{query}";

Key points

  • Use HttpUtility.UrlEncode (or Uri.EscapeDataString in .NET Core) on every parameter value that might contain reserved characters.
  • Ensure the base embedUrl already ends without a query part; add ? once, then & for subsequent parameters.
  • If the report only needs multiple numeric IDs you can skip XML entirely and pass them as a multi-value parameter:

Full Microsoft guidance: Paginated Reports – URL parameters

Try building the URL with the encoding applied and refresh the embedded viewer; you should now see the parameter values arriving intact. If parsing or report execution still fails, copy the final URL into a browser address bar to confirm the encoded XML string is complete.

✔️ If my message helped solve your issue, please mark it as Resolved!

👍 If it was helpful, consider giving it a Kudos!

v-menakakota
Community Support
Community Support

Hi  @Lakshmanan1    ,

Thanks for reaching out to the Microsoft fabric community forum. 

 

It looks like the issue might be due to special characters in your XML string. When passing XML as a parameter in a URL, make sure the value is properly encoded. Also, confirm that your paginated report is set up to accept and handle XML input.

And also please go through the below documents which may help you in resolving the issue

vmenakakota_2-1753331040989.png

 

https://learn.microsoft.com/en-us/power-bi/paginated-reports/parameters/pass-report-parameter-url

If I misunderstand your needs or you still have problems on it, please feel free to let us know.   

Best Regards, 
Community Support Team  

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.