Editing SSRS Reports for Epicor Cloud

Can you post the error you are getting?

Program Ice.Services.Lib.RunTask when executing task 416217 raised an unexpected exception with the following message: RunTask:
Ice.Core.SsrsReportService.ReportExecutionSoapException: Exception of type ‘Ice.Core.SsrsReportService.ReportExecutionSoapException’ was thrown.
SOAP Fault: An error has occurred during report processing. —> Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. —> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for dataset ‘BkLog’. —> System.Data.SqlClient.SqlException: Incorrect syntax near ‘T1’.)
Detail: rsProcessingAborted400An error has occurred during report processing.https://go.microsoft.com/fwlink/?LinkId=20476&EvtSrc=Microsoft.ReportingServices.Exceptions.ErrorStrings&EvtID=rsProcessingAborted&ProdName=Microsoft%20SQL%20Server%20Reporting%20Services&ProdVer=15.0.1102.897Microsoft SQL Server Reporting Services15.0.1102.8971033OsIndependent1033Microsoft.ReportingServices.ProcessingCoreAn error has occurred during report processing.Microsoft.ReportingServices.ProcessingCoreQuery execution failed for dataset ‘BkLog’..Net SqlClient Data ProviderIncorrect syntax near ‘T1’.)
at Ice.Core.SsrsReportService.ReportExecutionService.Render(String format, String deviceInfo, String& extension, String& mimeType, String& encoding, Warning& warnings, String& streamIds) in C:_releases\ICE\ICE4.2.200.11\Source\Shared\Lib\ReportingServices\ReportExecutionService.cs:line 154
at Ice.Core.SsrsReporting.SsrsRendererBase.Render(SsrsRenderInformationBase renderInformation) in C:_releases\ICE\ICE4.2.200.11\Source\Server\Internal\Lib\TaskLib\SsrsReporting\SsrsRendererBase.cs:line 148
at Ice.Core.SsrsReporting.SsrsRendererBase.TraceReportRendered(String printProgram, String ssrsRenderFormat, Func1 timedAction) in C:\_releases\ICE\ICE4.2.200.11\Source\Server\Internal\Lib\TaskLib\SsrsReporting\SsrsRendererBase.cs:line 0 at Ice.Core.SsrsReporting.ReportProcessorBase.RenderReport(String ssrsRenderFormat, String printProgram, Boolean ignorePageSettings) in C:\_releases\ICE\ICE4.2.200.11\Source\Server\Internal\Lib\TaskLib\SsrsReporting\ReportProcessorBase.cs:line 0 at Ice.Core.SsrsReporting.ReportProcessorBase.RenderReportForPreviewOrGenerate(RenderedSsrsReport renderedReport) in C:\_releases\ICE\ICE4.2.200.11\Source\Server\Internal\Lib\TaskLib\SsrsReporting\ReportProcessorBase.cs:line 422 at Ice.Core.SsrsReporting.ReportProcessorBase.ProcessReportPart(String reportLocation) in C:\_releases\ICE\ICE4.2.200.11\Source\Server\Internal\Lib\TaskLib\SsrsReporting\ReportProcessorBase.cs:line 163 at Ice.Core.SsrsReporting.StandardReportProcessor.ProcessReportParts() in C:\_releases\ICE\ICE4.2.200.11\Source\Server\Internal\Lib\TaskLib\SsrsReporting\StandardReportProcessor.cs:line 34 at Ice.Core.RoutingAndBreaking.ReportPersister.Persist(ReportInstanceInformation reportInstance, Func2 reportsRenderer, Action1 fillSysRptLstRow, Action2 processReport, Func3 filterTableAttachmentsFunc) in C:\_releases\ICE\ICE4.2.200.11\Source\Server\Internal\Lib\TaskLib\RoutingAndBreaking\ReportPersister.cs:line 58 at Ice.Core.RptBase.ReportSsrsDatabaseBuilder.RenderUnroutedSsrsReport() in C:\_releases\ICE\ICE4.2.200.11\Source\Server\Internal\Lib\TaskLib\RptBase\ReportSsrsDatabaseBuilder.cs:line 359 at Ice.Core.RptBase.ReportDatabaseBuilder.XMLClose() in C:\_releases\ICE\ICE4.2.200.11\Source\Server\Internal\Lib\TaskLib\RptBase\ReportDatabaseBuilder.cs:line 93 at Ice.Core.RptTaskBase1.XMLClose() in C:_releases\ICE\ICE4.2.200.11\Source\Server\Internal\Lib\TaskLib\RptBase\RptTaskBase.cs:line 260
at Erp.Internal.OM.OMR40_RP.RunProcess(Int64 instanceTaskNum, String outputFileName) in C:_releases\ERP\ERP11.2.200.0\Source\Server\Internal\OM\OMR40-RP\OMR40-RP.cs:line 285
at Ice.Hosting.TaskCaller.InnerExecuteTask(IceDataContext newContext) in C:_releases\ICE\ICE4.2.200.11\Source\Server\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 68
at Ice.Hosting.TaskCaller.ExecuteTask() in C:_releases\ICE\ICE4.2.200.11\Source\Server\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 64
at Ice.Lib.RunTask.BpmFriendlyTaskLauncher.Run(String sessionIdPrefix, IceContext db, Action taskRunner) in C:_releases\ICE\ICE4.2.200.0\Source\Server\Services\Lib\RunTask\BpmFriendlyTaskLauncher.cs:line 63
at Ice.Services.Lib.RunTaskSvc.InnerRunTask(Int64 ipTaskNum, Boolean suppressTransaction) in C:_releases\ICE\ICE4.2.200.0\Source\Server\Services\Lib\RunTask\RunTask.cs:line 450

And here is the current query:

=“SELECT T1.RptLanguageID,T1.Company,T1.CustGroup,T1.CustID,T1.GroupDesc, T1.CurrSymb, T1.LineDesc,T1.Name,T1.OrderLine,T1.OrderNum,T1.OrderRelNum,T1.PartNum,T1.ProdGroup,T1.ProdGrpDesc,CAST( T1.ReleaseValue as float ) as ReleaseValue,T1.ReqDate,T1.ShortName,T1.ShortPartNum,T1.TerritoryDesc,T1.TerritoryID,T1.UOM,T1.Value1,T1.Value2,T1.Value3,T1.Value4,T1.Value5, T2.PONum
FROM BkLog_” + Parameters!TableGuid.Value + " T1

LEFT OUTER JOIN OrderHed_" + Parameters!TableGuid.Value + " T2 ON T1.Company = T2.Company AND T1.OrderNum = T2.OrderNum"

I added the space before T1 because I was previously getting this error:

Program Ice.Services.Lib.RunTask when executing task 415723 raised an unexpected exception with the following message: RunTask:
Ice.Core.SsrsReportService.ReportExecutionSoapException: Exception of type ‘Ice.Core.SsrsReportService.ReportExecutionSoapException’ was thrown.
SOAP Fault: An error has occurred during report processing. —> Microsoft.ReportingServices.ReportProcessing.ProcessingAbortedException: An error has occurred during report processing. —> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for dataset ‘BkLog’. —> System.Data.SqlClient.SqlException: Invalid object name ‘BkLog_237964ca885b4855afa6625f72ca75b8T1’.)

It looked like it was adding the T1 to the TableGuid. I also tried to make it " as T1" and got an error that said “incorrect syntax near ‘8’” which there was no 8 in the query.

Look at your query in the report and fix the “fancy” quotation. This is a screen shot of your post to show you the “fancy” quotation. See the difference?

image

1 Like

One here too:

fq

2 Likes

Nice catch!

3 Likes

jott, if you are copying that query out into a different program and editing it there and then pasting it back in… you’ll probably get all messed up.

Not sure how others do it here, but I always edit in the query editor in SSRS.

1 Like

Or just plain old notepad. It’s my constant friend, even though I have better editors.

1 Like

Okay, yeah I haven’t experimented with different text editors to know whether one works or not.

I just don’t want to haha, I have terrible memories of banging my head on my desk wondering what was happening.

1 Like

Yup, Notepad, Notepad++, or XMLNotepad.

2 Likes

so it sounds like @jott you could use a plain old notepad.

Or Visual Studio Code. The poor-man’s Visual Studio but nice syntax highlighters with the SQL Extension.

But I am saying for that specific SQL statement inside the quotations I have had it get weird about an extra space here and there, or am I just imagining that?

Actually, you are correct. This isn’t SQL, it’s a string-builder… So,…

Never Mind GIF

VS Code is still a good free editor though…

1 Like

@utaylor , it is infuriating. I have had to format the whole query to fix something that I could not find.

1 Like

@jkane, @klincecum, @utaylor, @Mark_Wonsil

Thank you all for the help! I have been using notepad and vs code and thought surely those would get rid of any wonky quotations. I have liked notepad++ in the past so might have to download that as well. Fixing the quotations solved the errors! Still not getting the desired result, but at least I know the query is working and what was causing my issues there.

2 Likes

When I am trying to pull the PONum into the report it is remaining blank. You can see here it’s the first item I’ve added in the expression, am I doing something wrong?

Hi,

If you need to add OrderRel.PONum, you will need to add OrderRel as T3 table in the BKLog dataset. Properly do the left join with T1, and in your select clause, please add T3.PONum. Then you will see the desired result.

1 Like

Hi yluo, instead of the OrderRel table I decided to use the OrderHed table. Are you saying OrderHed won’t work? Thanks for the reply!

Hi Jeren,

In OrderHed, the PONum refers to the customer’s PO number, not yours. The PONum in OrderRel table is the your purchase order number to fullfill your demand.
I am not sure which PONum is the one you want, hope it helps.

4 Likes

I looked into it and did want to use the OrderHed table. I was able to get it working. My issue was I was trying to add it to the report like this ‘Format(Fields!OrderNum.Value,“#”)’ and was only getting “#” in my report. I added it with this syntax and it worked ‘=Fields!PONum.Value’, not sure exactly why it wouldn’t work the first way, but I’m happy to have gotten it working. Thanks for chipping in to help yluo.

And thank you everyone that chimed in here. You all were very helpful in making sure I was doing this correctly.