You need to sign in to do that
Don't have an account?
nickfs92840
Visual Force / HTML Output
I have a visual force page with a print function button that when pressed, generates a page out of salesforce. However, the print out does not look pretty.
Can someone help me in formatting my visualforce code to output something like the below? I created the below in Illustrator, but need some guidance on combining HTML and Visualforce code.
Please let me know.
Thanks!
In that case, thanks to the wonder of standard controllers, you will have an sobject named 'Highlight_Sheet__c' available to you. Thus to output a field named 'FieldOne__c', you would use:
All Answers
The best resource I've come across for this is the following wiki page:
http://wiki.developerforce.com/page/Creating_Professional_PDF_Documents_with_CSS_and_Visualforce
hmm, is there something else that is a more step by step? Because this wiki uses a thirdparty custom object that ties into an opportunities object already set in salesforce.
In following this post: http://bit.ly/GEYdrf
I need to figure out how to add my api field names into an HTML table. Any suggestions how the apex field names are to be named as?
Your API names will be available from the setup part of the UI - each field has a label and an API name when you define it. if you navigate to the object in question, If its a standard object, navigate to Customize -> <object name> -> Fields, or if its a custom object go to the Create -> Objects and choose the object in question. The list of fields will contain the field label and the field name - the field name equates to the API name.
Hi Bob,
I understand in obtaining the api names within SFDC, but what is the correct format to input into an html table like the below.This table will then be placed into the Visual Force page, so I'm looking for the correct <apex:XXXX> format.
So if my Filed Name is: FieldOne
and my API Name was: FieldOne__c
What would be the correct format?
Thanks!!!
If they are sobject fields, you'd use the apex:outputField to render them. Assuming the record is stored in sobj and the field API name is FieldOne__c, you'd use:
How can I find out where the record is stored in?
Is your visualforce page using a standard controller? If that is the case, it will be the name specified in that attribute.
This is how my VF page is set:
In that case, thanks to the wonder of standard controllers, you will have an sobject named 'Highlight_Sheet__c' available to you. Thus to output a field named 'FieldOne__c', you would use:
Getting closer. I didn't get any errors on my visualforce page, so that is good so far. However, the information comes up blank, see below next to Field Name. There is no data that pulls up.
I also included the HTML code below as well. Any thoughts?
Hi Bob, Ok, it did work, my value was originally blank but added information to the field.
Cool. Glad to hear you got there.
I do have one more question, in my output, I have two lookup fields that produce an underline as shown below with the arrows. Is there a way to remve these underlines? I provided some of my VF code below. Thanks!
I'd imagine these are appearing because the names are actually links. You can specify a style to the apex: outputField component, so you should be able to override at that point. It may be as simple as turning off the text decoration, e.g.
Thanks Bob! I also updated my .css file with:
the added apex code you provided
really helped!!!
Thank you!