function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Robin2154Robin2154 

Two-part question

Part One: How can I make an app open in the custom view that I created for that app? Part Two: How can I create a local .csv or .xls file from the data in the app? Thanks for all of your help. 

bob_buzzardbob_buzzard

Can you clarify what you mean by custom view?  Do you want to present a visualforce page as the home page for the app?

 

There's a number of ways to create a local file - I usually create a document or attachment and provide a visualforce page to allow downloading.  You could also write a visualforce page that displays as excel.  There's a blog entry explaining how to achieve this at:

 

http://blog.sforce.com/sforce/2008/12/visualforce-to-excel.html

Robin2154Robin2154

I've created an address book/directory listing app, and I've defined what I call a "custom view" which displays all of the fields/data in an Excel-type format, in alphabetical order by last name, which is exactly what I want. But when I open the app, it shows me some of the last names of the members (and only the last names, no other data), and they're in a kind of random order. In order to see my "custom view," I have to hit the "Go" button. Is there something that I can do to make the app open in the already customized view, or do I have to keep hitting the "Go" button every time I want to see all of the data, in the right order?

 

The link that you provided to convert a Visualforce page to an Excel file is exactly what I'm looking for (I think!). The key is, though, that I have to create a Visualforce page, right?

 

Thank you for all of your help.

bob_buzzardbob_buzzard

You would have to create a visualforce page for the excel rendering solution.

 

With regard to the other aspect, it really depends on what your Go button is doing.  Does it open a list view or report?

Robin2154Robin2154

Okay -- I've created a visualforce page (without the creation of the Excel file for now, just to see if I can actually publish the page), and when I preview the Active Site Home Page it looks fine; all of the columns and rows have the correct information. When I go to the actual URL, I only get the first column (Last Name) information. All of the other columns/rows are blank. What am I doing wrong?

 

I'm not sure what the "Go" button is set up as. When I hit it, it shows me all of the information the way it would look in an Excel spreadsheet, which is what I want. (I also want the information to look like that (more or less) on my published web page (see above issue, however)). Does that mean that the "Go" button is showing it to me in list view format?

 

Thanks again for your patience.

Robin2154Robin2154

(Addendum to last post) I've discovered how to edit/configure my Members tab so that it lists out all the information I want. Trouble is, it's alphabetizing the names in descending order. How do I set it to alphabetize them in ascending order? Thanks again.

bob_buzzardbob_buzzard

Are you still using the Visualforce page to display the members information or are you using a standard tab?  

 

If its a visualforce page you can tell the SOQL query that is retrieving the data how you want to order it.

 

 

bob_buzzardbob_buzzard

I'm a bit confused as to how you are accessing your app. You referred to sites in an earlier post - is that the mechanism?  If so, I don't understand why you'd see the tab home with the go button and list of recent items etc.

 

If you are referring to a standard tab, the go button allows you to jump to a list view.  If you click on the heading of a column in the list view, it will order the list by that column.  If you click the heading again it will reverse the order.  The list view should remember your previous selection when you return to it.

 

If you aren't referring to a standard tab, none of the above will help :)

Robin2154Robin2154

Yeah, I know I'm confusing you -- sorry! It's mostly because I'm confused myself.

 

There are 2 issues:

 

1) When I go to my Sites Detail screen, on the right-hand side where it says "Active Site Home Page (Preview)", if I click on that, it shows me my directory listing exactly how I want it, with all of the information, like an Excel spreadsheet. When I go to the Default Web Address and/or Secure Web Address and click on that, it only shows me the last names in the directory and no other information. I've discovered why that is, though -- in the object layout, the only field that has a red star and a blue dot next to it is the last name field. How do I turn on the red stars and/or the blue dots for the other fields so that they'll display on my real web page? (I think I probably only need the blue dots -- or do I?)

 

2) I've created a tab for my app and defined the layout to be the same as the way I'd like to see in displayed on my web page -- like an Excel spreadsheet with all of the information. When I choose that app, though, it goes to the tab but only shows, again, the last name, but this time in descending order. In order to display it in Excel spreadsheet format, I have to hit the "Go" button. Is there a way that when I choose the app it'll show me the Excel format immediately?

 

Also, are both of these issues related to the fact that the layout only has the last name flagged with the red star/blue dot? It seems like a funny coincidence otherwise. The only difference is that on the "live" web page the names are in ascending order and on the tab they're in descending. I really don't know what's going on here (as you can probably tell!)

 

Thanks again!

Robin2154Robin2154

(Addendum to last post) Sorry, I've misled you a bit. When I go to my app and/or just the tab, it actually shows me the last few records that I either added or edited. They are not in descending order. They kind of happened to be, because I entered them in alphabetical order, but I noticed one record, which I had edited in the middle of adding records, to be among the last ones that I had entered. So it looks as if it's showing just the last few that were touched by me (the editor/enterer). Still, that isn't the way I'd like to see them; I'd like to see them in Excel format order, alphabetical in ascending order. Again, possibly a layout problem?

 

Thanks!

Robin2154Robin2154

(Another addendum) Do I have to make the other fields required? That would be a problem, because there are going to be some records where some of the fields are not going to be filled out -- for example, some records are going to have one cell phone number and others will have two, or some records will have one e-mail address and others will have two. I don't want people to have to fill out every field, because some of them are not going to be relevant. What do I do?

Robin2154Robin2154

(Yet another addendum/question) Is there a way that I can display non-required fields on my web page so that I can make an .xls file of the information? I guess that's my bottom-line question.

bob_buzzardbob_buzzard

Are you accessing the site pages as an unauthenticated user (i.e you don't have to enter your user id and password)?  If so, you'll need to make the fields available to the guest user proflie for that site - go to your site page, lick public access settings and scroll down to the field security section and click the custom object name there - that will probably show you that most of the fields aren't visible to the profile.

 

Your tab in your app by default displays the home page, which lists the recently used objects. Clicking the Go button is opening a list view. You may be able to change this by defining a web tab as the home page for your app and setting the URL to that of the list view in question.

 

 

Robin2154Robin2154

Okay -- I made all of the fields visible in the public access settings, and it works great now; thanks! But now, I've also added code to my page creation code to save it off as an .xls file, which it does, but now it doesn't really display the data on the web page. I can open the .xls file and see the data, but I wouldn't want outside people to see the actual file. Does that mean that every time I need to make changes, I have to add the page creation code that would make a new version of the file, and then take out that code so that the information will display as a regular web page for outsiders? It won't do both at the same time -- display as a web page for outsiders and let me save it off as an .xls file?

bob_buzzardbob_buzzard

Normally what you'd do is have two visualforce pages, one that renders as excel and one that renders as a regular page.  In order to avoid replication of markup, you'd then move all the common markup into an apex component.

Robin2154Robin2154

Okay, thanks! How do I create the apex component? Really, the only difference in the two versions is the apex:page statement -- one of them would include the contenttype parameter.

bob_buzzardbob_buzzard

Thinking about this a little more, there may be a simpler way.

 

Assuming your regular visualforce page is called "MyPage", try pulling it in via apex:include in the excel variant.

 

Something like:

 

 

<apex:page ... contenttype="application/vnd.ms-excel">
	<apex:include pageName="MyPage" />
</apex:page>

 

 

Robin2154Robin2154

No, that didn't work. It acted as if the extra code wasn't even there; it just asked me if I wanted to save or open the file, and then didn't display anything. Thanks anyway!

bob_buzzardbob_buzzard

Bummer.  

 

There's good documentation on components in the VF developer's guide at:

 

http://www.salesforce.com/us/developer/docs/pages/Content/pages_comp_cust.htm

Robin2154Robin2154

Okay, thanks!

Jonye KeeJonye Kee

In the event that its a visualforce page you can see the SOQL question that is recovering the information how you need to arrange it.

office cleaning Perth (https://sparklecommercialcleaning.com.au/office-cleaning-perth/)