In one of the report after hitting the export button out 2000 records from the straight table only 6 records doesn't gets exported on an excel sheet. But when I do a right click and send to excel I get all the 2000 records. Not sure why it's happening, can somebody please guide. I checked my data model files and all records are present in the data model. Below is the macros for the export button:
dim o ExportPath = ActiveDocument.Variables("vExportPath").GetContent.String ObjectID = ActiveDocument.Variables("vObjectID").GetContent.String ChartName = ActiveDocument.GetSheetObject(ObjectID).GetCaption.Name.v Set o = ActiveDocument.GetSheetObject(ObjectID) o.ExportBiff ExportPath & ChartName & ".xls"
The only reason I could imagine is that there are some "special" chars within those records which vbs-macros couldn't handle and ignore them without giving an error-message (silent failure). I know such behaviour from vba-macros which I use for writing txt-files from sources which I couldn't control - I use in this case a white-list filter for checking each char and if it's not included within the white-list it will be replaced with a space-char.
But this won't be really practically by exporting this object - it's rather the worst-case approach to write these object cell by cell and char by char to excel. More practically might be a cleaning within the qlikview-load or by declaring the dimensions by using functions like keepchar() or purgechar() on this field which caused this behaviour.
Therefore try to check out if there are any strange chars within your data - checking len() and visible word-lengths, using ord() to get numeric index and something similar. But the easiest way to check this could be to use this for the object-dimensions: