• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Populate a cfgrid without query

New Here ,
Mar 02, 2012 Mar 02, 2012

Copy link to clipboard

Copied

I'm fairly new to ColdFusion.  So, forgive me if this is a stupid question.

I'd like to populate a cfgrid with data from a csv file.  Is there any way to do this?  I know I can read in the file and put it into an array of structs.  Is there a way to use the array to populate the cfgrid?

Thanks,

Nicole

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 02, 2012 Mar 02, 2012

Regarding:

Thanks again, all my googling was leading me to believe it wasn't possible.

Au contraire mademoiselle.  As cfsearching said, CFHTTP can convert (well formed) csv files into queries.  When you google "cfhttp" and find the adobe docs, pay attention to the name attribute.

Votes

Translate

Translate
Valorous Hero ,
Mar 02, 2012 Mar 02, 2012

Copy link to clipboard

Copied

You can populate grids manually by looping and using cfgridrow . Alternatively, you could also convert the csv file into a query, instead of an array. Then you could use cfgrid's query attribute.  CFHTTP can convert (well formed) csv files into queries. There is also the CSVToQuery function from cflib.org.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 02, 2012 Mar 02, 2012

Copy link to clipboard

Copied

Thanks!  So many options!   I had checked cflib.org, but apparently used poor search terms.  Since I have control over the format of the csv file, I can use your ideas for turning my file into a query, that way I don't have to control paging.  Thanks again, all my googling was leading me to believe it wasn't possible.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 02, 2012 Mar 02, 2012

Copy link to clipboard

Copied

LATEST

Regarding:

Thanks again, all my googling was leading me to believe it wasn't possible.

Au contraire mademoiselle.  As cfsearching said, CFHTTP can convert (well formed) csv files into queries.  When you google "cfhttp" and find the adobe docs, pay attention to the name attribute.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation