How to Remove Fields from Report Datasource

Hi, I have a report wherein I’m using embedded datasources - the typical way of building a report. The problem is say e.g. I use SalesLine, InventSum and say some other tables having large number of fields but I want only some specific fields. When you bind a datasource, the default behaviour is it takes all fields from all tables in your datasources. How to remove the unwanted fields from Report datasource? Because if you run a trace and see the log file you can see the sql query which is sent from Axapta and it’s too big comprising of all fields, now to add to this say e.g. if i have some memo fields in salestable then this will definitely affect performance because even if i don’t want the select query will be getting the field. One workaround I tried is to create a view and embed the datasources in view, and then select only the fields in view which i want to show in report, this way when i again run the trace it takes only the fields in the view…But I’m just thinking is there a way to delete the fields from datasource which one doesn’t want?? Dilip

Hi Dilip, no there is not AFAIK. That’s Axapta standard behaviour. And because of it, never put large fields (especially BLOBs) in standard tables, but add new tables instead which you only call when you need it. regards, harald

Hi, Dilip If you right click on your Fields node on the embedded DS, you will see something like: Add Field, Add Sum, Add MAx, etc. Just by using Add Field you can select only the fields you really need to show from this datasource. In code it is done like in the following example: (in the Init method of the datasource, for example) this.query().dataSourceTable(tableNum(YourTableWithAlotOfFields)).addSelectionField(fieldNum(YourTableWithAlotOfFields, FieldYouNeed)); if you need an agregate, you can specify in after fieldNum(), SelectionField::Sum, for example. And if you change your mind and want to select all fields again, there is a property on each dataSource: Dynamic. Setting it to Yes, you restore all the fields it has. Hope this helps.

Thx Ivan! That is what I have been looking for to avoid loading company logo when it is not needed. br,


Thx Ivan! That is what I have been looking for to avoid loading company logo when it is not needed. br,
Originally posted by Esa - 2005 Oct 14 : 07:09:35

U can also upload your logo to sysimage Table,and call it when you want it/[^]