Skip to main content
March 9, 2021
Question

Excel file not getting generated.

  • March 9, 2021
  • 7 replies
  • 0 views

Hi,

I am trying to generate excel document by using the a!exportDataStoreEntityToCsv(). Below is my code snippet:

load(
local!exportDocId,
local!errorMessage,
{
if(
isnull(local!exportDocId),
a!linkField(
labelPosition: "COLLAPSED",
links:a!dynamicLink(
Label: "Export Inactive Users Details to Excel",
saveinto:{
a!exportDataStoreEntityToCsv(
entity: cons!VW_EPMT_EWR,
selection: a!querySelection(
columns:{
a!queryColumn(
field: "ewr_number"
),
a!queryColumn(
field: "name"
),
a!queryColumn(
field: "active"
)
}
),
documentName: "EWR Grid Record Data",
saveInFolder: cons!EWR_FOLDER,
onSuccess: a!save(
local!exportDocId,
fv!newDocument
),
onError: a!save(
local!errorMessage,
"Error in Exporting File"
)
)
}
)

),
{}
),
if(
not(isnull(local!exportDocId)),
a!linkField(
links:a!documentDownloadLink(
Label:"Download Excel File",
document: local!exportDocId
)
),
a!textField(
value:local!errorMessage,
readonly:true
)
)
}
)

Now when i am clicking on the link in design interface, it gives the below error:

Interface Definition: Expression evaluation error: An error occurred while executing a smart service: Error accessing data store entity: VW_EPMT_EWR. Please contact a system administrator for additional details. (APNX-1-4505-026).

Could anyone please help me out by identifying the mistake. Any help will be appreciated.

Thanks,

Anandita

7 replies

peter.lewis
Employee
March 9, 2021

Is there any more information in the logs? Usually the application server logs are a good place to start troubleshooting.

acaciob0002
March 9, 2021

Hi Anandita,

I have a similar scenario here and I tested your code using my data store, it is working just fine.

Perhaps you should check the fields names in the queryColumns it should match the CDT instead the Table.

Regards,

Acacio B.

March 10, 2021

Hi Acacio B, 

I cross checked my field names they are similar to the ones in CDT but still getting the error.

Also, I tried using another CDT which is working as expected an the excel is getting downloaded too. 

Here, I presume the view is holding a large set of data and hence taking time to fetch it, resulting in that error. Now if that is the real problem then I am not sure how to fix that. Could you please suggest?

Thanks,

Anandita

acaciob0002
March 11, 2021

Hi Anandita,

Have you considered the possibility to move the Excel generation to a Process Model? You could replace the linkfield for a startProcessLink and try to achieve the same result but using the Smart Service instead the function.

That is the way how I'm doing my exports:

You could try at least to create a test Process Model and check if it run without errors.

Regards,

Acacio B.

January 5, 2023

Starting Excel in safe mode. Disabling COM add-ins. Disabling Excel add-ins. Moving files from startup folders used by Excel.

Click File > Options > Add-ins.
Select COM Add-ins, and click Go.
Clear all the checkboxes in the list, and click OK.
Close and restart Excel in normal mode (not in safe mode).

Regards,

Will

August 19, 2025

hi [mention:dca5630f7e914a6f93c70dc95ddcb7ee:e9ed411860ed4f2ba0265705b8793d05]  , i have the same issue have you Found the Answer for it?