how to show items against a puchid in a report

Hi All,

When I just select the PurchId in the PurchTable form the same PurchId is get shown on the report I have attached in that Form.

The datasource used in the report are PurchTable and PurchLine

This I have done by using the fetch method like this:->

public boolean fetch()

{

QueryBuildDataSource qbs;

QueryRun qr;

qr = new QueryRun(element);

cur = element.args().record();

element.send(cur);

return true;

}

But now also want to display all the items against that particular purchid in the report .How can I do this .Please help me.

Hi All,

Is there no way of achieving the result of the question asked above.

Please any one of you have any idea about it,please share .

Thanks

Abhishek Bhati

Hi Abhishek,

Add a relation In your purchLine datasource relating it to purchTable.purchId.

Call to super() should not be commented in your fetch method.

By doing this, you may get record from purch lines also.

Try and update your status

Hi imran,

Ya I already have given the relation in data source I.e PurchTable.purchId==PurchLine.PurchId;

Please if you knows the solution can elaborate it that what i should write in the fetch method .As also i m nt calling any super in fetch method.

Hi Abhishek,

Your fetch method should be like this.

public boolean fetch()

{

boolean ret;

QueryRun qr;

QueryBuildDataSource qbds;

PurchTable purchTable ;

;

qr = new QueryRun(element);

purchTable = element.args().record();

qbds = this.query().dataSourceName(“your datasource name”);//purchTable

qbds.addRange(fieldNum( purchTable , PurchId)).value( purchTable . purchId);

ret = super();

return ret;

}

And, you should add relation in your purchLine table as well …

Regards

Imran

Hi imran,

Thank You very much for the post .I tried he same fetch method but still its not working.Also i noticed that in this method we are not using Purch line nd item id anywhere .

Is this the correct way of doing it.

There is no need to specify the purchline or item Id as the call to super() will execute the query.

The fetch method in my previous post selects one record from PurchTable and execute the body of purchTable as well as all purchLines that corresponds to the selected purchId one by one.

Is there a body section for PurchLine in your design?

Ya …I have taken body to show the items in the report…

Hi Imran,

When i edit some of your code ,I am getting the items on the report but all items are getting displayed not the one corresponding to a particular purch id …

I only want to show those which are against a particular id.

Thanks

Abhishek Bhati

Hi,

Try as following…

public class ReportRun extends ObjectRun
{
purchTable externalpurchTable ;
}

public void init()
{
externalpurchTable = element.args().record();
super();

}

public boolean fetch()

{

ret = true;

Select PurchTable(DataSourceTableName) where PurchTable.PurchId == externalpurchTable .PurchId

element.Send(PurchTable);

While select PurchLine(Ur Line Datasource name) where PurchLine.purchId == PurchTable.PurchId

{

element.send(PurchLine);

}

}

return ret;

}

Hi Jyothi,

Thank You very much …It realy helped me in solving my issue…realy appreciate ur knowledge.

Thank You once again.:slight_smile:

Hi Jyothi,

Is the same thing possible when instead of SalesTable and SalesLine we have to take CustInvoiceJour and CustInvoiceTrans table.

As with these table ,it is giving an error.

The reason why i want to do this is i want to attach this report to the the Sales Table form and presently there the system report is being shown to which i have to replace with the report i have made.

Hi ,

Do u want to replace ur report with standard report?

ya jyothi ,exactly i want to do the same …please help if you know any solution for this .

Hi,

Look into this

http://parimalajyothijp.blogspot.in/2012/02/replacing-our-report-with-standard.html

Instead of SalesTable and salesLine use ur datasource names

Hi Jyoti,

I have one same query but slightly different …

I have created a new report Dom_TaxInvoice and i want to link this report on SalesTable Form like Packiinglist,salesInvoice,Dom_TaxInvoice.

In that report datasource is CustInvoiceTrans. It is possible to link the report on SalesTable form.

Please help me…

Thanks

Hi Darshana,

  • use SalesTable = element.args().record();

  • Relate the CustInvoicejour with SalesTable

  • Send ur line database by relating with CustInvoicejour

Thanks Jyoti… its working now.

Hi Jyothi,

Its working… i.e i have created a new report Dom_TaxInvoice =>Datasource CustInvoiceTrans and link this report to SalesTable form.

When we open Dom_TaxInvoice report it shows the data correctly But when we create a partial Invoice on SalesTable form and open the report all items related to salesid display on report. it is not correct …

Please help me…

Hi Darshana,

For partial invoice , once u open the custinvoicejour table u will find two fields one salesId and originalSalesId

supose if u do invoice for 00001 and 00002

in custInvoiceJour in one field it takes

field1 field2

00001 00001

00001 00002

Make sure to run ur report on field2 instead of field1