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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sharvan270
Regular Visitor

Unable to upload paginated report that has custom code to PowerBI portal using PowerShell Script

Unable to upload paginated report that has simple custom code to the PowerBI portal using  the Powershell script.

 

sharvan270_0-1631888222401.png

 

 

               Report is invalid. ErrorCode: rsUnexpectedCompilerError, Details: An unexpected error occurred while compiling expressions. Native compiler return value: [BC42105] Function TestFun doesnt return a value on all code paths. A null reference exception could occur at run time when the result is used..

 

The above error is shown for every report we try to upload.

 

sharvan270_1-1631888222405.png

 

 

Custom Code:

Public Function TestFun() As String

        Return  "hi"

End Function

 

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @sharvan270,

What type of license are you worked on? As the document said, currently you can only publish the paginated reports to the workspace that hosts in premium capacity.

Publish a paginated report to the Power BI service - Power BI | Microsoft Docs

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
CVVR
Frequent Visitor

Hello Guys,

 

Any help on this?

 

We are using the below url to post the rdl file.

https://api.powerbi.com/v1.0/myorg/groups/$GroupId/imports?datasetDisplayName=$fileName&nameConflict...

 

Is there any way to skip the compilation error and continue the upload ?

 

Thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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