I am trying to combine two views on the same line as plain text. Both views use "Unformatted list" setup. Both views have rewriting settings set to "Strip HTML tags" and "Remove whitespace," and no styles are applied to the view results. I've also removed all row classes and styles from the view settings.

The views results have blank space between them, no matter what settings I try to use.

I need the data to come out as a CSV. There are spacers: extra commas, zeros, spaces in quotes, and zeros in quotes that must be included for the file to work properly in a client application that will import the file. Because of the spacers, I cannot use the Views Data Export function to properly format the file. I cannot edit the source code of the client application, so I will not be able to handle an error if spaces get into the fields I need to use.

Comments

DrupalWoody created an issue. See original summary.

DrupalWoody’s picture

Priority: Normal » Major
DrupalWoody’s picture

Issue summary: View changes
DrupalWoody’s picture

 

DrupalWoody’s picture

Priority: Major » Critical
dev18.addweb’s picture

There can be extra divs still present between the views. To remove those follow the steps:

1) Edit every field and go to "style settings"
2) Click on "Customize field HTML". Select "-None-" from "HTML element"
3) Click on "Customize label HTML". Select "-None-" from "Label HTML element"
4) Click on "Customize field and label wrapper HTML". Select "-None-" from "Wrapper HTML element"

Let me know incase of any queries/concern regarding the same.

damiankloip’s picture

Category: Bug report » Support request
Priority: Critical » Normal

Thanks for the reply! That should help. Otherwise you might need a custom style or display a plugin to achieve what you need. This module just renders a particular view and display. So it's not really this modules problem I'm afraid.

There is also no way this is a critical bug.

DrupalWoody’s picture

You're right. It's not critical. I'm really very sorry about that. I'm still fairly new to Drupal and I could not--for the life of me--figure out where that problem was coming from.

Your solution does the job.

What I was seeing is that Views Data Export does not properly allow removal of white space in its output. The programming I needed has been moved to that module instead, and it works properly.

DrupalWoody’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

subhojit777’s picture

It also works if you enable this setting Trim whitespace from rendered fields. Can be useful for some themes where output results in extra newlines.. You will find this setting for CSV export.

DrupalWoody’s picture

There's a long story about sending data to a client database that only accepts data if it's downloaded in plain text (not .csv) files. It has no API unless the owner wants to pay "an arm and a leg" (lots of money) for the developer license, which I can understand why they do not.

Basically, their database accepts batches of online orders so it can track product inventory and customer records. That way, the shop keeps its inventory and customer lists up to date.

Since each line of the view is a different part of the customer's order, and not a csv file, the method used is counter-intuitive. The view that assembles the downloaded batch is the only one exporting any data, and the plain text download does not support "Trim whitespace from rendered fields."

Each line of the view contains different order data:

1.) Customer Profile
2.) Order Header
3.) Payment amount and date/time
4.) Order notes (special instructions from the customer, like "leave package on back porch")
5.) All the line items from that order.

A batch containing three downloaded orders will repeat items #1 through #5 three times.

Views Field View assembles the batch from the five separate views used to gather the data. If this view were converted into a csv, instead of being on separate lines, the batch would be run together as:

1,2,3,4,5

and not:

1
2
3
4
5

And that would stop the database from importing it.

Anyway, the result was a theme modification for the view, as shown by https://www.drupal.org/project/views_data_export/issues/2827207

jsimonis’s picture

Just ran into this on my D8 install. The solution that worked for me was subhojit777. Wanted to post a comment saying as such in case someone else came across this like I did. :)