4

im working on "create PDF document from list item" in Sharepoint 2013. im using JSPDF by this instruction. http://social.technet.microsoft.com/wiki/contents/articles/31695.generating-a-pdf-document-in-sharepoint-2013.aspx

I have problem when im using data.d.*** property. If property/column is Radio button or Lookup column, PDF creatin is not workig.

Can someone tell me how to fix this?

Or any other way how to create PDF from large list item?

Thank a lot.

1

You can programatically access the document library using the object model or via web services.

If you use the object model. You can use the SPContext object to get the current site/list. From there, you can iterate through the items or, you can use a method on the SPList object to turn it into a dataset which you could then use to generate a PDF using some kind of PDF library (e.g. PDF4NET). If you go this route the best way to roll it out is by packaging it up as a feature in a solution file (.WSP) which you can deploy to your farm. In this case the code would be running in the share point environment. You can get pretty fancy with this and have something like a "Print PDF" menu option in the action menu for all lists.

On the other hand, you could also access the list remotely using the web services. In such a case you could just use this as a data provider for your reporting package.

1

When you say "not working" what does that mean?

Does it not display the value for that field?

Does it not generate the PDF at all?

Is there an error message? Have you run it with the F12 debugger on on the browser so you can step through it and see any errors?

The way I normally do this is with SQL Server Reporting Services. I create a report with the data source being the SharePoint list and with a parameter that is the list item ID. Then I put a button on the form that opens a URL to the report, passing the current item ID as the parameter.

0

For lookup fields, you should use expand in URL of ajax call. Refer this

This one will explain how to expand and use lookup fields.

  • Hi, welcome to community. You should add some details or explanation of the reference link you are providing. Explanation of reference link helps in better understanding of your answer. You can edit this answer and add some details. – Ankitkumar Malde Jun 19 '18 at 6:49

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.