After getting a list of record in my lightning component from an apex controller, I want to pass the data to a visualforce page for printing the data. Please, I'd like to know how can I send the data from component to the VF page for doing the print.

Thanks in advance!

  • What is use case...? How are you using vf in conjunction with LC...is it iframe inside LC? – Ayub Jun 2 '19 at 9:04
  • @Ayub I am looking for the best solution possible. I want to display the data on the VF page as a pdf when I click on the search button in my lightning component – dibocor Jun 2 '19 at 10:06
  • I would suggest ..best solution would be to do not mix lightning and vf...use separate controller for vf...as it will load separately ..so should not be an issue related to performance – Ayub Jun 2 '19 at 10:35
  • thank you @Ayub for your suggestion. just a question, if I use separate controller for vf, how will I be able to transmit the filtered information? – dibocor Jun 2 '19 at 16:34
  • @dibocor Can you update how you fixed the issue. I need to pass the data from LC to VF page which has large data. And LC is not added in that specific VF page – SFDC Feb 26 at 11:32

You can pass some of the basic parameters in the URI for your VF page and then use the parameters to get whatever data you need to display in your PDF.

Eg: URI= /apex/Mypage?id='idvalue'&parameter='parametervalue'

| improve this answer | |
  • I am receiving a bad header 404 error (Too much data). passing a JSON string which is actually a list of data. – SFDC Feb 26 at 11:29

It sounds like you need either a custom controller or an extension that the page calls when it loads.

| improve this answer | |
  • Thanks @Brooks Johnson for you reply, in case I use a custom controller for my VF page, how will I be able to transmit the filtered informations? – dibocor Jun 2 '19 at 16:37
  • I have a form in my lightning component that allows filtering the information – dibocor Jun 2 '19 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.